Skip to content

chore: Remove small molecule test species#2433

Open
trisyoungs wants to merge 2 commits into
develop2from
dissolve2/remove-small-molecule-test-species
Open

chore: Remove small molecule test species#2433
trisyoungs wants to merge 2 commits into
develop2from
dissolve2/remove-small-molecule-test-species

Conversation

@trisyoungs
Copy link
Copy Markdown
Member

@trisyoungs trisyoungs commented May 14, 2026

Removes yet more code-constructed test species and converts them to TOML. Also adds Species::load() to load a species directly, useful in unit tests.

This work removes most of the usages of modifying functions in the Species class, making refactor it a lot easier!

Comment thread src/classes/species.cpp
Comment on lines +344 to +345
auto name = contents["species"]["name"].as_string();
setName(name.str);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
auto name = contents["species"]["name"].as_string();
setName(name.str);
if (contents.contains("species"))
deserialise(contents["species"])

I feel that my preference would be to have the species name set inside deserialise - this would contain the responsibility to fully initialise the species from TOML within a single method.

Then, this would become ^

Is there any reason we don't do this already?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

To be honest I've been ignoring this a bit, but ultimately the Species class doesn't need a name_ member as this should be the SpeciesNode name. However, the relationship between those two things is not quite clear to me at present. I agree that the name could / should be set in the deserialise(), so I'll make that change.

trisyoungs added a commit that referenced this pull request May 15, 2026
trisyoungs added a commit that referenced this pull request May 15, 2026
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