Closed KatieWoe closed 3 years ago
Also from the same slack thread:
Amy Rouinfar 4:23 PM H-C-N and C-N-H are both legal structures. C-H-N is not a legal structure. 4:23 We should change the goal text for hydrogen cyanide to HCN.
@Denz1994 if it is trivial to change the chemical formulas in collectionMoleculesData.js, I'd also like to make these changes:
I'm a bit confused since I think at least some of those are already right? I think I just saw silane come up and it was right.
Ammonia is wrong though. So maybe I saw silane wrong
I was assuming that the chemical formula that appears in the collection came directly from collectionMoleculesData.js. I am pretty sure I saw H3N
and O2S
earlier today. I'll play with the collections a bit more to make sure.
Looks like an odd mixed bag:
Because these entries come directly from the PubChem database, we would need to review the entries or develop a post-processing step to follow a heuristic for editing the formula names. It seems like PubChem doesn't follow a pattern. It would be reasonable to at the least check the collection box goal molecules.
These are found in collectionMoleculesData.js mentioned above.
Of the five molecules that have an odd chemical formula ordering in collectionMoleculesData.js, three of them appear to be use the more preferable chemical formula ordering in the collection:
These two molecules use the exact chemical formula ordering in collectionMoleculesData.js, and I think the ordering is less than ideal.
Other chemicals that are more complicated seem impacted as well:
Wikipedia says the above should be N2H4
Not sure of this one, so posting just in case:
I don't think there's anything we can or should do about molecular formulas in otherMoleculesData.js. PubChem lists H4N2 as an acceptable formula for Hydrazine. I think PubChem is using a convention where the formula is ordered C > H > N > O.
To be clear, the formulas for hydrogen cyanide and ammonia are not wrong when ordered this way, but they just look weird. I think HCN
and NH3
are going to be more familiar to students, which is why it'd be nice if the formulas could show up that way in the collections. @Denz1994 is that possible?
@arouinfar We have an internal function used to get the formula of molecules this is in MoleculeStructure.getGeneralFormula
.
More specifically here are some comments from the code:
// carbon first, then hydrogen, then others alphabetically, otherwise sort by increasing electronegativity
This relates to the order of elements in the formula. Also here are some exception cases for H3N and CHN below.
'H3N': 'NH3', // treated as if it is organic
'CHN': 'HCN' // not considered organic
I'll continue with the suggested changes you posted above, but I wanted to leave this here in case it gives more context.
Okay, molecules should be fixed in the above commit. I'll verify it with @arouinfar.
Here are the other examples requested above:
@arouinfar Based on the images above do these formulas look correct? If so, we can close this issue.
@Denz1994 the screenshot for hydrogen cyanide shows CHN
instead of HCN
. The other examples all look good.
Apologies, I've posted an image from a broken version. Here are the proper HCN
molecule and goal text.
It looks like this RC has the correct ordering. Thanks for the input. Closing this one.
For https://github.com/phetsims/QA/issues/538 From Slack: