-
-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flexible data structure for model-specific parameters #443
Conversation
Codecov Report
@@ Coverage Diff @@
## master #443 +/- ##
=========================================
+ Coverage 58.91% 59.12% +0.2%
=========================================
Files 381 384 +3
Lines 40229 40340 +111
Branches 6681 6679 -2
=========================================
+ Hits 23701 23850 +149
+ Misses 14564 14528 -36
+ Partials 1964 1962 -2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@speth This looks good to me, and very useful. I like that the structure/syntax of the AnyMap
mirrors the expected format from the YAML input file, and also that the syntax is very close to Python dictionaries.
A few questions, just to make sure I understand:
Is the plan that XML/CTI/YAML files will be used to generate an AnyMap
, which is then used to instantiate various objects? That seems like it would fantastic!
Just to make sure I understand, std::map
only allows one type of key and one type of value, whereas the AnyMap
allows any combination if either?
Right, the idea is that a YAML file will be used to generate an For XML, there are a couple of ways of handling it, depending on how long we want to support the existing XML format. To maintain longer-term support, XML files could also be parsed into The |
This PR adds a new type-flexible data structure (
AnyMap
) for storing model-specific data. It can be used instead ofXML_Node
trees to store model parameters without needing to create a family of classes with various specializations just to hold this data.Here, an instance of this data structure is attached to the
Species
class to hold species properties relevant to the Debye-Huckel model (and some of the other electrolyte models) so thatDebyeHuckel
objects can be instantiated without requiring XML phase and species definitions.I think it would also make sense to use this same location to store the standard state model parameters for each species with the
Species
object so thatPDSS
objects could be automatically created rather than needing to be manually instantiated and added to phase objects that require them (see some of the tests inphaseConstructors.cpp
for an example of the current approach).