Skip to content

Commit

Permalink
Revert "Added a cdk.saveCML(List<? extends IMolecules>, String) to sa…
Browse files Browse the repository at this point in the history
…ve lists of molecules as CML"

Causes regressions.

This reverts commit 00a8777.
  • Loading branch information
egonw committed Aug 28, 2011
1 parent 00a8777 commit 9e8dd18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 41 deletions.
Expand Up @@ -1333,17 +1333,6 @@ public void testSaveMDLMolfile() throws Exception {
));
}

@Test
public void testSaveCMLList() throws Exception {
List<ICDKMolecule> molecules = cdk.createMoleculeList();
molecules.add(cdk.fromSMILES("CCC"));
molecules.add(cdk.fromSMILES("CCO"));
molecules.add(cdk.fromSMILES("COC"));
String path = "/Virtual/testSaveCMLfile" + molecules.hashCode() + ".cml";
cdk.saveCML(molecules, path);
// cannot read it yet, but for now, if it did not crash
}

@Test
public void testSaveCML() throws Exception {
ICDKMolecule propane = cdk.fromSMILES("CCC");
Expand Down
Expand Up @@ -50,6 +50,7 @@
import net.bioclipse.core.domain.IMolecule;
import net.bioclipse.core.domain.IMolecule.Property;
import net.bioclipse.core.domain.RecordableList;
import net.bioclipse.core.domain.SMILESMolecule;
import net.bioclipse.core.util.LogUtils;
import net.bioclipse.jobs.IReturner;
import net.bioclipse.managers.business.IBioclipseManager;
Expand Down Expand Up @@ -910,24 +911,21 @@ public void saveMolecule( IMolecule mol,
*/
public void saveMolecules( List<? extends IMolecule> molecules,
String path,
IChemFormat filetype, IProgressMonitor monitor )
IChemFormat filetype )
throws BioclipseException, CoreException {

saveMolecules( molecules,
ResourcePathTransformer.getInstance().transform(path),
filetype,
null) ;
filetype) ;
}

/**
* Save a list of molecules in SDF or CML
*/
public void saveMolecules( List<? extends IMolecule> molecules,
IFile target,
IChemFormat filetype,
IProgressMonitor monitor)
IChemFormat filetype )
throws BioclipseException, CoreException {
if (monitor == null) monitor = new NullProgressMonitor();

if ( filetype == CMLFormat.getInstance() ||
filetype == MDLV2000Format.getInstance() ||
Expand Down Expand Up @@ -2031,17 +2029,6 @@ public void saveCML(ICDKMolecule cml, String filename)
saveMolecule(cml, filename, (IChemFormat)CMLFormat.getInstance());
}

public void saveCML(List<? extends IMolecule> molecules,
String filename, IProgressMonitor monitor)
throws BioclipseException, InvocationTargetException,
CoreException {
saveMolecules(
molecules, filename,
(IChemFormat)CMLFormat.getInstance(),
monitor
);
}

public void saveMDLMolfile(ICDKMolecule mol, String filename)
throws InvocationTargetException,
BioclipseException,
Expand Down
Expand Up @@ -39,6 +39,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.content.IContentType;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IChemModel;
Expand Down Expand Up @@ -777,19 +778,6 @@ public void saveCML(ICDKMolecule cml, String filename)
BioclipseException,
CoreException;

@Recorded
@PublishedMethod(
params = "List<? extends IMolecule> molecules, String filename",
methodSummary = "Saves a list of molecules in the Chemical Markup Language " +
"format (filename must be relative to workspace " +
"root and folder must exist). Example of file " +
"String: \"/Virtual/bla.cml\"" )
@TestMethods("testSaveCMLList")
public void saveCML(List<? extends IMolecule> molecules, String filename)
throws InvocationTargetException,
BioclipseException,
CoreException;

/**
* Loads molecules from a SMILES file.
*
Expand Down

0 comments on commit 9e8dd18

Please sign in to comment.