Skip to content
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

Prelude to YAML serialization #795

Merged
merged 19 commits into from
Jan 21, 2020
Merged
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0beadf8
Make treating AnyMap as vector<AnyMap> easier in some cases
speth Jan 11, 2020
6b051c0
[Input] Allow 'equation-of-state' field to contain multiple model opt…
speth Jan 11, 2020
902a4ec
[Input] Skip over hidden keys when iterating over AnyMap
speth Jan 6, 2020
e89a4ea
Make canonical names of factory-registered types accessible
speth Nov 12, 2019
a5ce147
Add functions for factory alias management
speth Nov 12, 2019
26edb23
[Input] Make YAML designated names canonical for factories
speth Nov 12, 2019
8f07ebc
Implement equality comparisons for AnyValue / AnyMap
speth Nov 15, 2019
0a89f21
Handle equality comparisons for types converted by AnyValue
speth Nov 15, 2019
972330b
[Kinetics] Fix creation of surface reactions depending on phase order
speth Nov 24, 2019
e9c936a
Make use of AnyValue equality comparisons
speth Nov 20, 2019
b8c3f7c
[Input] Fix reading of long integers in YAML files
speth Nov 25, 2019
e1c12c2
Add 'clear' method to AnyMap
speth Nov 25, 2019
78fc3b1
[Input] Use more general data structure for AnyMap metadata
speth Dec 11, 2019
8662f3c
Standardize names used for pure substance models
speth Nov 25, 2019
2d2c1e2
[Input] Move Debye-Huckel species parameters to their own sub-field
speth Jan 13, 2020
2b5fe59
[Input] Make string-based instantiation of IonsFromNeutral possible
speth Jan 14, 2020
89b5ca2
[Input] Make string-based instantiation of LatticeSolid possible
speth Jan 14, 2020
cdef8c7
[Thermo] Fix pure fluid state restoration after property calculation
speth Jan 14, 2020
4447096
[Doc] Small improvements to YAML API docs
speth Jan 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/base/AnyMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,14 @@ struct convert<Cantera::AnyValue> {
// Scalar nodes are int, doubles, or strings
std::string nodestr = node.as<std::string>();
if (isInt(nodestr)) {
target = intValue(nodestr);
try {
target = node.as<long int>();
} catch (YAML::BadConversion&) {
// This exception is raised if the value doesn't fit in a
// long int, in which case we would rather store it
// (possibly inexactly) as a double.
target = node.as<double>();
}
bryanwweber marked this conversation as resolved.
Show resolved Hide resolved
} else if (isFloat(nodestr)) {
target = fpValue(nodestr);
} else if (isBool(nodestr)) {
Expand Down