Skip to content

refactor: Dissolve2 CIF #2425

Open
RobBuchananCompPhys wants to merge 14 commits intodevelop2from
dissolve2/cif-refactor-part-1
Open

refactor: Dissolve2 CIF #2425
RobBuchananCompPhys wants to merge 14 commits intodevelop2from
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

// Option
addOption<std::string>("FilePath", "File path", filePath_);
addOption<bool>("PreventMetallicBonds", "Whether to prevent metallic bonding", preventMetallicBonds_);
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.

Another option that can be gotten rid of.

#include "classes/structure.h"
#include "data/spaceGroups.h"
#include "math/matrix4.h"
#include "neta/neta.h"
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.

Presumably not needed any more...

Suggested change
#include "neta/neta.h"

Comment on lines +57 to +63
/*
* CIF I/O
*/

/*
* Raw Data
*/
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.

Suggested change
/*
* CIF I/O
*/
/*
* Raw Data
*/
/*
* Basic CIF Data
*/

Comment on lines +39 to +45
/*
* CIF I/O
*/

/*
* Raw Data
*/
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.

Suggested change
/*
* CIF I/O
*/
/*
* Raw Data
*/
/*
* Basic CIF Data
*/

Comment on lines +36 to +37
// Whether to prevent metallic bonding
bool preventMetallicBonds_{true};
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.

Suggested change
// Whether to prevent metallic bonding
bool preventMetallicBonds_{true};

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.

Comment on lines +119 to +122
/*
* End CIF I/O
*/

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.

Suggested change
/*
* End CIF I/O
*/

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...

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