Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new MolecularFormulaGenerator #103

Closed
wants to merge 5 commits into from
Closed

Conversation

tomas-pluskal
Copy link
Contributor

Creating a pull request as discussed on the cdk-devel list.

* </pre>
*
* The code was originally developed for a MZmine 2 framework module, published
* in Pluskal et al., Anal Chem 2012.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you should use the {@cdk.cite ...} approach. This works pretty much like @cite{} in LaTeX and the matching "BibTeX" file is here: https://github.com/cdk/cdk/blob/master/doc/refs/cheminf.bibx

duplicated MoleculaFormulaRangeManipulatorTest entry
*
* @cdk.module test-formula
*/
public class MolecularFormulaGeneratorTest extends CDKTestCase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this list of tests also include the tests MassToFormulaToolTest?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included similar tests to MassToFormulaToolTest (with some modifications), and I also added a few more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not object against porting the original tests... (wishlist level... not too important)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I included those MassToFormulaToolTest tests that were relevant to MolecularFormulaGenerator. Or, maybe I don't comprehend your request?

@egonw
Copy link
Member

egonw commented Dec 29, 2014

Generally looks like a nice and clean patch. I haven't tried compiling it, nor ran the tests, though.

@tomas-pluskal
Copy link
Contributor Author

I made a few corrections according to Egon's comments.

@tomas-pluskal
Copy link
Contributor Author

Should I merge the commits into a single one and create a new pull request?

@egonw
Copy link
Member

egonw commented Dec 29, 2014

No, rather keep them separate as is now: https://github.com/cdk/cdk/pull/103/commits

That way, we can just review the updates, rather than everything again.

@egonw
Copy link
Member

egonw commented Dec 29, 2014

OK, with the updates, if it compiles, I'm happy for it to go in!

Tomas, John, what do you think about the old code? If this new code that all the things the old code does (does it?), maybe the old class should be removed?

Tomas, or is the old code an intrinsically different algorithm that may have different applications and we need to ask Miguel if the old code can be removed?

@tomas-pluskal
Copy link
Contributor Author

The results (formula sets) generated by both algorithms are (must be) equal.
The only additional thing that the old code does is sorting the results. But that is a trivial functionality.
In my opinion, the old code can be removed. But I don't know if there is any software out there that depends on it. That's why I marked the old class as @deprecated. Perhaps it can be removed sometime later, if nobody complains? Or, you can remove it now, considering how slow the old code is (pretty much unusable for anything above 400 Da).

@johnmay
Copy link
Member

johnmay commented Dec 29, 2014

If existing usages can be replaced (elsewhere in the library) the old one should be moved to the deprecated module rather than removed completely.

@egonw
Copy link
Member

egonw commented Dec 29, 2014

Is there a way to have Jenkins report on the usage of deprecated code (outside the testing code)?

@tomas-pluskal
Copy link
Contributor Author

The old MassToFormulaTool is not used anywhere in the CDK library.

@johnmay
Copy link
Member

johnmay commented Dec 29, 2014

Okay applied and pushed, just going to move the old version. Two more pointers.

  • MformulaTests is a legacy from the ant build and ignored
  • https://github.com/cdk/cdk-build-util/blob/master/src/main/resources/net/sf/cdk/tools/doclets/cheminf.bibx is the one that matters cheminf.bibx was left in the main repo at request of Egon but is superficial.

@johnmay johnmay closed this Dec 29, 2014
@tomas-pluskal
Copy link
Contributor Author

Why not move the MformulaTests and the old cheminf.bibx to the deprecated(legacy?) module as well? Cleaning up junk makes it easier for newcomers to make contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants