Skip to content

Structure importers: cannot import the same structure twice. #381

@cpignedoli

Description

@cpignedoli

Suppose I have two importers: "from file" and "SMILES":

If I do the following:

  1. Create a molecule from SMILES C=C, I will obtain the correct C2H4 molecule
  2. After that, I import the file.xyz, and the molecule will be correctly replaced by the uploaded structure.
  3. Then, switching back to SMILES and pressing "Generate molecule" will do nothing because the SMILES string is unchanged.
  4. Modifying the SMILES string to another value (C for instance) correctly provides a new molecule.
  5. Additionally, if I go back to "Import from computer" and re-import the same file. xyz, it will do nothing again. If I import a different file, it will work.

It seems to be related to the traits notification problem. Since the trait somehow keeps the same value it does not notifies the structure update.

Additional observation.

For an unknown reason the information about the change of the structure trait of an importer doesn't go to the input_structure of the manager, even though it should:

dlink((importer, "structure"), (self, "input_structure"))

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions