Closed arouinfar closed 4 years ago
This issue is due to structuresData.js
not containing the valid structure for C4
as-built above.
More details regarding implementation:
The allowed structures are validated every time and atom is attempted to bond (see Kit.attemptToBondMolecule
). From this, the attempted bond is validated against the master list structuresData.js
of allowed structures via a hash string. If the structure that is built from the molecule bonds (StrippedMolecule
) doesn't exist in that master list, then it is rejected.
The workaround is to amend the structuresData.js
with the entry for C4
as it is built and bonded above. @jonathanolson didn't see why this structure shouldn't exist and perhaps this is related to the need to regenerate new data for the structures (similar to #158). There is a sanity check to prevent looping but that didn't seem promising when removing the check (see MoleculeStructure.hasLoopsOrIsDisconnected
)
@arouinfar Can you confirm that C4
can be created in master?
Note: The above measures to prevent looping were implemented to prevent structures like this.
@Denz1994 something's still not quite right. I can connect 4 carbons in a straight line, but I'm then unable to attach any hydrogens to the carbon chain UNLESS I first attach something else like an N or O.
I'm also finding cases like this that I can make in Java, but not in HTML5:
However, the data for this molecule can be found in OtherMoleculesData.js
acetic acid ethyl ester|C4H8O2|8857
The structure data has been inputted for the above-mentioned molecules. Can you confirm this is the case on Master @arouinfar?
Things are generally working now @Denz1994. I'm seeing some buggy behavior that I'm not 100% sure how to consistently reproduce. Occasionally, I am unable to create large molecules, and it seems like it happens if I've used the button to cut all bonds
Can you play around with it a bit and see if you can figure out what's going on? I also recommend having QA bang away on this issue during the next dev test.
@Denz1994 something strange is going on. I'm currently trying to verify #169, and was trying to build acetic ethyl acid ester from https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-585432259. I was able to build it earlier today on master (see the screenshot in #169), but now I don't seem to be able to.
My current procedure is:
C-C-O-C
by dragging atoms out of the bucket and immediately connecting them to the chain.C-C-O-C-C
but it bumps away like it's an illegal structure.EDIT: I was able to get around this by adding the 2nd oxygen before trying to connect the 4th carbon. The order in which atoms are connected should not matter.
Alternative step 3:
Adding 4th carbon is now possible:
Regarding https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-606233607:
A testing cycle may look something like this:
*The point is the order of the build path shouldn't matter to construct the molecule
I've tried these steps with the below molecules and can't replicate the concerns brought up https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-606233607. @arouinfar Should we add more molecules to test? Also, what do you think about the above-proposed testing cycle?
Here are the molecules I tested with:
@arouinfar Could you try this dev version for reviewing https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-606283587. The build order for acetic ethyl acid ester
shouldn't matter in this build.
@arouinfar and I revisited the issue mentioned in https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-606233607. I wasn't able to reproduce locally, and @arouinfar thought this may be related to chrome caching an older version of BAM. We thought a QA member could take a look at this.
@KatieWoe Summary: The order by which a molecule is built shouldn't matter. It was noted that occasionally building a molecule in a specific order fails. I've given some instructions on https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-611099900 to help test this issue. Could you try these steps on a few large molecules and determine if the build order affects if they can be built or not? I've listed some molecules that may be a good start above.
You can create https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-584965693 in the above dev version @Denz1994
Were you able to replicate https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-611099900 @KatieWoe?
No, but I haven't been able to dedicate a lot of testing time to it due to other tests.
@Denz1994 @KatieWoe I am unable to reproduce the exact problem described in https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-606283587, but I'm running into a related problem. It seems like the issue is localized to molecules containing chains like C-C-O-C-C
or C-O-C-C-C
. After building these chains, I am unable to attach any hydrogens to the carbons, despite there being several structures in the database that contain these chains.
Procedure:
C-C-O-C-C
, adding atoms in order from left-to-right.I misinterpreted the check that prevents https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-584965693. This was allowed in the legacy version as well.
The concern was regarding a user no knowing what atoms are bonded in the example in https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-584965693. However, with the addition of the cut targets (yellow circles), it clearly shows what atoms are bonded. I don't think this is an issue. Tagging @arouinfar to confirm.
Also, the above commits should have fixed the order dependent bonding problem that was mentioned by @arouinfar above. Can you test in this dev version @arouinfar?
@jonathanolson and I did some intense deep-diving into the visitor arrays in checkEquivalency()
. It looks like I was removing the incorrect items from the visited atoms causing these false equivalencies.
Dev version: https://phet-dev.colorado.edu/html/build-a-molecule/1.0.0-dev.74/phet/build-a-molecule_en_phet.html
This appears to be fixed in dev.74 @Denz1994.
If the sim is in a good place, it would be nice to publish a new prototype to the website.
This issue has been listed for QA to test with specific instructions in https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-611099900.
I noticed (using https://github.com/phetsims/QA/issues/506) that, if the molecule is built in a certain way, there may not be room to add some of the atoms needed. Is this acceptable?
Trying to build this in a slightly different configuration:
No room to add last atoms:
Correct me if I'm wrong @arouinfar, but I think the second image in https://github.com/phetsims/build-a-molecule/issues/148#issuecomment-641437201 is technically a different molecule. For instance, the center carbon doesn't have two fluorines bonded to it.
If that is the case then this is acceptable.
It is a different molecule, but I was trying to build the top one. That second Fluorine can't be added because there is no room for it, it just bounces off. That is what I was trying to report.
Ah, I see now. I think this is more in line with the atom layering issue. I don't think this is necessarily buggy behavior anymore because the user picked a path to build the molecule in a way that makes them run out of space. This is different than having the space to build and the correct atoms and it failing.
I'll leave to @arouinfar for input.
I don't think this is necessarily buggy behavior anymore because the user picked a path to build the molecule in a way that makes them run out of space. This is different than having the space to build and the correct atoms and it failing.
Agreed @Denz1994. I think it's important for students to thoughtfully place their atoms when building large molecules. I don't see the current behavior as a bug, but rather a productive constraint.
Noticed during #131
It should be possible to connect four carbons in a straight chain, but that's not currently possible.![4-c](https://user-images.githubusercontent.com/8419308/73103813-2b503900-3eb2-11ea-9218-6bc5cc6910e9.gif)
However, it is possible to connect them in this arrangement![image](https://user-images.githubusercontent.com/8419308/73103886-55a1f680-3eb2-11ea-8871-2bed6166f1ae.png)