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

exact molecular mass and average molecular mass #6

Open
bddap opened this issue Jun 13, 2022 · 2 comments
Open

exact molecular mass and average molecular mass #6

bddap opened this issue Jun 13, 2022 · 2 comments

Comments

@bddap
Copy link
Contributor

bddap commented Jun 13, 2022

A new feature mentioned in #5 (comment)

@bddap
Copy link
Contributor Author

bddap commented Jun 13, 2022

Looking into the atom representation,

pub element: Option<Element>,

The optional element makes this inappropriate:

fn molecular_mass_average(mol: &impl Molecule) -> Da;

leaving this as a sensible option:

fn molecular_mass_average(mol: &impl Molecule) -> Option<Da>;

Is element: None meant to indicate a SMARTS wildcard?

@rapodaca
Copy link
Owner

rapodaca commented Oct 8, 2023

element: None could be used for systems (like SMILES) that have the notion of optional elements. It could also be used for cases, aside from specific serialization formats, in which the element is unknown. This does mean than mass calculators would need to check for a missing element, but that's just the type system enforcing the problem's constraints.

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

No branches or pull requests

2 participants