Skip to content

Fix serialisation of Species Site with TOML#1701

Merged
rprospero merged 3 commits into
developfrom
species-site-toml
Nov 14, 2023
Merged

Fix serialisation of Species Site with TOML#1701
rprospero merged 3 commits into
developfrom
species-site-toml

Conversation

@rprospero
Copy link
Copy Markdown
Contributor

Support for Dynamic and Fragment sites has now been added. Please note that

  • Dynamic Sites support a list of element.
  • Fragment Sites take a description string
  • All site types support an originMassWeighted toggle

I'm happy to add other parameters if they are need. These were just the ones required to pass the tests.

@rprospero rprospero added 16 DIfficulty: 16 TOML Deals with the conversion of custom file formats into TOML labels Nov 14, 2023
@rprospero rprospero requested a review from trisyoungs November 14, 2023 11:09
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.

Just one comment, otherwise all looks nice.

Comment on lines +778 to +783
auto typeString = toml::find_or<std::string>(node, "type", "Static");
if (typeString == "Static")
type_ = SiteType::Static;
else if (typeString == "Fragment")
type_ = SiteType::Fragment;
else if (typeString == "Dynamic")
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.

Rather than going to the effort of putting this string check in here it would be generally more useful to put in an EnumOptions associated with the SiteType. That would necessitate reducing it to a simple enum rather than an enum class. Small thing though, and not related to TOML, so feel free to leave or capture as a new issue.

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.

I've added issue #1706 to track this and I'm adding it to my master issue for putting TOML before the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

16 DIfficulty: 16 TOML Deals with the conversion of custom file formats into TOML

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants