Skip to content

refactor: Dissolve2 CIF #2425

Open
RobBuchananCompPhys wants to merge 20 commits into
develop2from
dissolve2/cif-refactor-part-1
Open

refactor: Dissolve2 CIF #2425
RobBuchananCompPhys wants to merge 20 commits into
develop2from
dissolve2/cif-refactor-part-1

Conversation

@RobBuchananCompPhys
Copy link
Copy Markdown
Contributor

@RobBuchananCompPhys RobBuchananCompPhys commented Apr 30, 2026

This PR lays the ground work for refactoring the CIF node ecosystem into a more condensed form, where a (most likely) single node - ImportCIFStructureNode - returns a Structure * created from the species atoms and any connectivity parsed from the import .cif file. Virtually all of the Dissolve1 functionality for managing .cif import and parsing has been migrated into the node/cif/io folder. This includes the cif-relevant ANTLR4 classes.

@RobBuchananCompPhys RobBuchananCompPhys marked this pull request as ready for review May 5, 2026 09:57
Base automatically changed from dissolve2/structure-class to develop2 May 6, 2026 10:17
@RobBuchananCompPhys RobBuchananCompPhys force-pushed the dissolve2/cif-refactor-part-1 branch from 9e73738 to e7ce154 Compare May 6, 2026 11:00
Copy link
Copy Markdown
Member

@trisyoungs trisyoungs left a comment

Choose a reason for hiding this comment

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

Two significant comments to make:

  1. We could remove all of the old "secondary" CIF nodes which just adjust things in the main context since we need to reimplement them in node form anyway. That would break unit tests for the time being, but its probably easier to do that than try to maintain both while we work it up.
  2. My thought was that we could completely remove use of Configuration and Species and generate a Structure directly from the contents of the CIF.

@RobBuchananCompPhys RobBuchananCompPhys force-pushed the dissolve2/cif-refactor-part-1 branch from c50f630 to e14f873 Compare May 8, 2026 12:35
Comment thread src/nodes/cif/importCIFStructure.cpp Outdated
Comment thread src/nodes/cif/importCIFStructure.h
Comment thread src/nodes/cif/importCIFStructure.cpp
Comment thread src/nodes/cif/importCIFStructure.h
Comment thread src/nodes/cif/importCIFStructure.h Outdated
Comment on lines +106 to +107
// Temporary atom types used for unique atom labels
std::vector<std::shared_ptr<AtomType>> atomLabelTypes_;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I wrote this - I don't like it any more! It's a strange use of AtomType. I'll flag this on the Dissolve2ToDo as something to refactor.

Copy link
Copy Markdown
Contributor Author

@RobBuchananCompPhys RobBuchananCompPhys May 11, 2026

Choose a reason for hiding this comment

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

We should be able to use the new capability for string name on StructureAtom that you added in #2427 to link the newly added structural atom to the relevant atom type bonding pairs information. That way, we shouldn't need the atomLabelTypes_ vector.

Comment thread src/nodes/cif/importCIFStructure.h Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How come the graphene species dialog got removed here? I don't recall there being any dependence on CIF in there! This is definitely destined for a node, too...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Looks like I got a bit trigger-happy with anything that had an apparent CIFContext include... I've looked at the code in more depth, and the dialog doesn't appear to actually make use of the class (now removed), so we could in all likelihood reinstate it (without including nodes/cif/io/cifContext.h)!

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.

2 participants