-
-
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
Add script to convert CTML to YAML input format #693
Commits on Dec 2, 2019
-
[ctml2yaml] Add first working version of ctml2yaml
Correctly converts GRI-3.0 from CTML to YAML format.
Configuration menu - View commit details
-
Copy full SHA for b49359f - Browse repository at this point
Copy the full SHA b49359fView commit details -
[ctml2yaml] Simplify handling of species transport properties
Check that values for properties are not equal to zero and only include them in that case.
Configuration menu - View commit details
-
Copy full SHA for 4c8050d - Browse repository at this point
Copy the full SHA 4c8050dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f958a5 - Browse repository at this point
Copy the full SHA 9f958a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9af1131 - Browse repository at this point
Copy the full SHA 9af1131View commit details -
[ctml2yaml] Handle more complicated speciesArrays
Can now handle undeclared element options and species arrays located in another file.
Configuration menu - View commit details
-
Copy full SHA for 6327208 - Browse repository at this point
Copy the full SHA 6327208View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf4cc43 - Browse repository at this point
Copy the full SHA cf4cc43View commit details -
Configuration menu - View commit details
-
Copy full SHA for 349857e - Browse repository at this point
Copy the full SHA 349857eView commit details -
Configuration menu - View commit details
-
Copy full SHA for d6a5d41 - Browse repository at this point
Copy the full SHA d6a5d41View commit details -
[ctml2yaml] Fix composition string processing
Composition strings can be separated by comma or by space with no differences. Also, the value could be an int or a float, so check both. Use updated function to set the elemental composition of species.
Configuration menu - View commit details
-
Copy full SHA for 6af0ad0 - Browse repository at this point
Copy the full SHA 6af0ad0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a87071 - Browse repository at this point
Copy the full SHA 2a87071View commit details -
[ctml2yaml] Allow density as a thermo property
In phase definitions, density can be specified for certain thermo models
Configuration menu - View commit details
-
Copy full SHA for 0a397dd - Browse repository at this point
Copy the full SHA 0a397ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8479d42 - Browse repository at this point
Copy the full SHA 8479d42View commit details -
Configuration menu - View commit details
-
Copy full SHA for adaae42 - Browse repository at this point
Copy the full SHA adaae42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9a34719 - Browse repository at this point
Copy the full SHA 9a34719View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed684d7 - Browse repository at this point
Copy the full SHA ed684d7View commit details -
[ctml2yaml] Allow reactions to be filtered
Reaction entries can now be filtered as specified in the include node of the reactionArray node. Fix typo in transport key name at phase level.
Configuration menu - View commit details
-
Copy full SHA for 4096b7c - Browse repository at this point
Copy the full SHA 4096b7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3e7569 - Browse repository at this point
Copy the full SHA f3e7569View commit details -
[ctml2yaml] Fix integer-like reaction IDs error
reaction_id nodes that look like integers (e.g., '0001') are being read as integers by the parser and converting them to strings throws errors. The fix is to only include the reaction_id if it doesn't look like an integer.
Configuration menu - View commit details
-
Copy full SHA for d3b0c29 - Browse repository at this point
Copy the full SHA d3b0c29View commit details -
Configuration menu - View commit details
-
Copy full SHA for f2485cb - Browse repository at this point
Copy the full SHA f2485cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for dde5546 - Browse repository at this point
Copy the full SHA dde5546View commit details -
[ctml2yaml] Improve formatting of output file
Add metadata to the output. Add newlines between each top-level key.
Configuration menu - View commit details
-
Copy full SHA for ece6ebe - Browse repository at this point
Copy the full SHA ece6ebeView commit details -
[ctml2yaml] Simplify handling of NumPy functions
Use a global flag to determine the available formatting functions from NumPy. Move some functions around for readability.
Configuration menu - View commit details
-
Copy full SHA for c76c53e - Browse repository at this point
Copy the full SHA c76c53eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7826037 - Browse repository at this point
Copy the full SHA 7826037View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac80882 - Browse repository at this point
Copy the full SHA ac80882View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0804e0 - Browse repository at this point
Copy the full SHA f0804e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for af71fed - Browse repository at this point
Copy the full SHA af71fedView commit details -
[ctml2yaml] Simplify YAML output section
This change simplifies how classes are registered with the YAML emitter.
Configuration menu - View commit details
-
Copy full SHA for 3f484e2 - Browse repository at this point
Copy the full SHA 3f484e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8cd35b6 - Browse repository at this point
Copy the full SHA 8cd35b6View commit details -
[ctml2yaml] Check for empty species section
Species can be specified in another data source.
Configuration menu - View commit details
-
Copy full SHA for fa4eed6 - Browse repository at this point
Copy the full SHA fa4eed6View commit details -
[ctml2yaml] Add R-K equation of state
The XML file for this test wasn't already present in the repo, so convert the CTI file to XML first.
Configuration menu - View commit details
-
Copy full SHA for 5be317c - Browse repository at this point
Copy the full SHA 5be317cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 635d592 - Browse repository at this point
Copy the full SHA 635d592View commit details -
[ctml2yaml] Add diamond conversion test
This commit includes some work-around for the fact that electron-cloud phases include the density in the phase definition but fixed-stoichiometry phases put the density in the species definition.
Configuration menu - View commit details
-
Copy full SHA for 3b8b86e - Browse repository at this point
Copy the full SHA 3b8b86eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 08c567e - Browse repository at this point
Copy the full SHA 08c567eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f7667d - Browse repository at this point
Copy the full SHA 2f7667dView commit details -
[ctml_writer] Fix warning invalid escape sequence
The docstring for the reaction class has some math formatting. This was causing an invalid escape sequence warning during build. The fix is to make the docstring a raw string.
Configuration menu - View commit details
-
Copy full SHA for d1e1fcf - Browse repository at this point
Copy the full SHA d1e1fcfView commit details -
Configuration menu - View commit details
-
Copy full SHA for bfaa1a2 - Browse repository at this point
Copy the full SHA bfaa1a2View commit details -
Requires multipel reactionArray nodes, multiple speciesArray nodes, and the option to skip undeclared third body species.
Configuration menu - View commit details
-
Copy full SHA for 6046cc4 - Browse repository at this point
Copy the full SHA 6046cc4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7ae7f75 - Browse repository at this point
Copy the full SHA 7ae7f75View commit details -
Configuration menu - View commit details
-
Copy full SHA for 88634a9 - Browse repository at this point
Copy the full SHA 88634a9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e4d64a - Browse repository at this point
Copy the full SHA 3e4d64aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3239940 - Browse repository at this point
Copy the full SHA 3239940View commit details -
Configuration menu - View commit details
-
Copy full SHA for ee690e8 - Browse repository at this point
Copy the full SHA ee690e8View commit details -
[ctml2yaml] Use speciesData id name
If a speciesData node has an id other than species_data, use it to label the corresponding section in the YAML output file.
Configuration menu - View commit details
-
Copy full SHA for 449fbd2 - Browse repository at this point
Copy the full SHA 449fbd2View commit details -
[ctml2yaml] Add Shomate species thermo
Fixes error when speciesData has an id attribute other than species_data and the phase is StoichSubstance.
Configuration menu - View commit details
-
Copy full SHA for be0e17e - Browse repository at this point
Copy the full SHA be0e17eView commit details -
[ctml2yaml] Specialize for Redlich-Kwong EOS
The R-K EOS is moving activity coefficient data from the phase node to the species node in YAML. However, other phases are retaining this data in the phase node. This change specializes the previous processing of the activityCoefficient node to be only for the R-K phase thermo model.
Configuration menu - View commit details
-
Copy full SHA for 9e1598c - Browse repository at this point
Copy the full SHA 9e1598cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ed782b - Browse repository at this point
Copy the full SHA 3ed782bView commit details -
[ctml2yaml] HMW-electrolyte and piecewise-Gibbs
Use ThermoPhase to load the input files rather than Solution. This avoids a bug in TransportFactory that would be hit by using Solution.
Configuration menu - View commit details
-
Copy full SHA for 47d33fb - Browse repository at this point
Copy the full SHA 47d33fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for c435b84 - Browse repository at this point
Copy the full SHA c435b84View commit details -
[ctml2yaml] Add Debye-Huckel phase-thermo type
The implementation is not quite complete, some refactoring needs to be done to make it easier to move data from the phase node to the species nodes.
Configuration menu - View commit details
-
Copy full SHA for 49bf4b5 - Browse repository at this point
Copy the full SHA 49bf4b5View commit details -
[ctml2yaml] Rename Species parameter species_node
Just clarify what the input argument is
Configuration menu - View commit details
-
Copy full SHA for 28f4c78 - Browse repository at this point
Copy the full SHA 28f4c78View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8fc20ee - Browse repository at this point
Copy the full SHA 8fc20eeView commit details -
[ctml2yaml] Refactor species and reaction creation
Create Species and Reaction objects before Phase objects. This allows the Phase constructor to modify the appropriate objects based on reaction filtering or various equation of state models where information is moving from the phase node to the Species.
Configuration menu - View commit details
-
Copy full SHA for c76891d - Browse repository at this point
Copy the full SHA c76891dView commit details -
[ctml2yaml] Use the fancy new error classes
Use error classes that better describe what is missing and print the actual node instead of its memory address
Configuration menu - View commit details
-
Copy full SHA for a388402 - Browse repository at this point
Copy the full SHA a388402View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1418d1a - Browse repository at this point
Copy the full SHA 1418d1aView commit details -
[ctml2yaml] Change XXXX_attribs to just attribs
For Species and Reaction classes. This makes it easier to reference these attributes and the extra specifier is not needed because it is implied by the type of class already.
Configuration menu - View commit details
-
Copy full SHA for e61f4b8 - Browse repository at this point
Copy the full SHA e61f4b8View commit details -
Configuration menu - View commit details
-
Copy full SHA for c7181a3 - Browse repository at this point
Copy the full SHA c7181a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 66ce20b - Browse repository at this point
Copy the full SHA 66ce20bView commit details -
[Thermo] Make sure the neutral phase is initialized
In the IonsFromNeutral phase, make sure the neutralMoleculePhase is initialized before we try to use it. This prevents a segfault if the input YAML file does not have the neutral-phase key.
Configuration menu - View commit details
-
Copy full SHA for e2af32a - Browse repository at this point
Copy the full SHA e2af32aView commit details -
[Thermo] Check that special species was specified
In the IonsFromNeutral phase, if a special-species is not included the index is never set after initialization and remains at npos. The check here ensures that a special-species is specified. Also move building the elemVectorI outside of the jNeut loop. It doesn't appear to need to be done for every neutral species, so this would save some effort
Configuration menu - View commit details
-
Copy full SHA for 1de5d66 - Browse repository at this point
Copy the full SHA 1de5d66View commit details -
[Thermo] IonsFromNeutral can specify the neutral phase in another file
When specified in YAML input, the neutral-phase can now be specified as being in another file by using a / to delimit the file from the phase name. This is similar to specifying species or elements in another file. This brings back parity with the XML specification of these phases.
Configuration menu - View commit details
-
Copy full SHA for 3b5bcca - Browse repository at this point
Copy the full SHA 3b5bccaView commit details -
[ctml2yaml] Margules and ions-from-neutral phases
Add Margules and ions-from-neutral-molecule phases. Margules is not complete, it is missing the interaction parameters.
Configuration menu - View commit details
-
Copy full SHA for bc58b9c - Browse repository at this point
Copy the full SHA bc58b9cView commit details -
[ctml2yaml] Add Motz-Wise correction option
If the Motz-Wise option is specified at the global reactionData node level, this is used to set the option for all the reactions in that node that don't otherwise specify the option. This method is easier than setting the equivalent phase-level option.
Configuration menu - View commit details
-
Copy full SHA for 70f062a - Browse repository at this point
Copy the full SHA 70f062aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 09975ee - Browse repository at this point
Copy the full SHA 09975eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for b2f87f4 - Browse repository at this point
Copy the full SHA b2f87f4View commit details -
[ctml2yaml] Parse pathological species names
These changes allow parsing composition map strings where colons are allowed as characters in keys in a colon delimited map, as well as handling comma or space separated pairs where commas are also valid characters in the keys.
Configuration menu - View commit details
-
Copy full SHA for 7b2a2f9 - Browse repository at this point
Copy the full SHA 7b2a2f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 51ae226 - Browse repository at this point
Copy the full SHA 51ae226View commit details -
Configuration menu - View commit details
-
Copy full SHA for 80816a3 - Browse repository at this point
Copy the full SHA 80816a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for df6bcc8 - Browse repository at this point
Copy the full SHA df6bcc8View commit details -
Configuration menu - View commit details
-
Copy full SHA for b10d1d8 - Browse repository at this point
Copy the full SHA b10d1d8View commit details -
[ctml2yaml] Refactor SpeciesThermo for polynomials
Extract a method to process the polynomials. Ensure that sorting of the temperature ranges correlates with the sorting of the data.
Configuration menu - View commit details
-
Copy full SHA for 794905c - Browse repository at this point
Copy the full SHA 794905cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 89fd38b - Browse repository at this point
Copy the full SHA 89fd38bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7c800db - Browse repository at this point
Copy the full SHA 7c800dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1474d7 - Browse repository at this point
Copy the full SHA f1474d7View commit details -
Configuration menu - View commit details
-
Copy full SHA for b9522a4 - Browse repository at this point
Copy the full SHA b9522a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1745c4a - Browse repository at this point
Copy the full SHA 1745c4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for eb5dbc6 - Browse repository at this point
Copy the full SHA eb5dbc6View commit details -
[ctml2yaml] Rework reaction type factory
The changes now match all of the options in newReaction, including synonyms. Butler-Volmer parameters are deprecated so the user is warned. Simplify processing interface type reactions into one method, since the electrochem node is optional.
Configuration menu - View commit details
-
Copy full SHA for 0534b11 - Browse repository at this point
Copy the full SHA 0534b11View commit details -
Configuration menu - View commit details
-
Copy full SHA for c5c0902 - Browse repository at this point
Copy the full SHA c5c0902View commit details -
Configuration menu - View commit details
-
Copy full SHA for 645a86a - Browse repository at this point
Copy the full SHA 645a86aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a74c97 - Browse repository at this point
Copy the full SHA 3a74c97View commit details -
[ctml2yaml] Fix trailing space if units is empty
Add a docstring for get_float_or_units. Use the clean_node_text function.
Configuration menu - View commit details
-
Copy full SHA for 76ab074 - Browse repository at this point
Copy the full SHA 76ab074View commit details -
Configuration menu - View commit details
-
Copy full SHA for 844f4a0 - Browse repository at this point
Copy the full SHA 844f4a0View commit details -
[ctml2yaml] Retain zero values in the YAML output
As demonstrated in Cantera#683, sometimes the zero values are intentional and meaningful. Rework the SpeciesTransport class to not use this function.
Configuration menu - View commit details
-
Copy full SHA for 0ec1c9d - Browse repository at this point
Copy the full SHA 0ec1c9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 66c1433 - Browse repository at this point
Copy the full SHA 66c1433View commit details -
[ctml2yaml] Fix several XML parsing errors
The Python Expat parser requires that the <?xml version...> tag occur as the first characters in the file, even before any blank space, so lstrip is used to remove any whitespace. In addition, raw & characters are replaced with their escaped version.
Configuration menu - View commit details
-
Copy full SHA for dfd4e6d - Browse repository at this point
Copy the full SHA dfd4e6dView commit details -
[ctml2yaml] Combine duplicate section ids
If a reactionData or speciesData node has a duplicated id attribute, combine the duplicate sections together. If duplicate reaction id attributes or species names are found, either warn or raise an error.
Configuration menu - View commit details
-
Copy full SHA for e31ad91 - Browse repository at this point
Copy the full SHA e31ad91View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3376fcb - Browse repository at this point
Copy the full SHA 3376fcbView commit details -
[Doc] Add documentation for ctml2yaml script
Add intersphinx extension to auto-link to Python docs. Bump KaTeX version.
Configuration menu - View commit details
-
Copy full SHA for 1d62ec0 - Browse repository at this point
Copy the full SHA 1d62ec0View commit details -
[ctml2yaml] Add QUANTITY type definition
A quantity is a value that can be either just a number (i.e., a float) or a number plus a unit (i.e., a str).
Configuration menu - View commit details
-
Copy full SHA for 6a47942 - Browse repository at this point
Copy the full SHA 6a47942View commit details -
[ctml2yaml] Add command line arguments
Add parsing of arguments passed when the script is run from the command line. A new function is introduced to parse the arguments and is the default function when the file is executed as a script. Update the documentation to add the new function. Add a new argument to convert that takes a string containing the content of a CTML file. This allows convert to be used from within the Python interpreter more easily.
Configuration menu - View commit details
-
Copy full SHA for 06627ed - Browse repository at this point
Copy the full SHA 06627edView commit details -
[ctml2yaml] Improve error messages
Node tag names are now quoted for clarity.
Configuration menu - View commit details
-
Copy full SHA for c525c7e - Browse repository at this point
Copy the full SHA c525c7eView commit details -
[ctml2yaml] RK does not need activityCoefficients
The Redlich-Kwong phase-thermo model doesn't require the activityCoefficients node. If not specified, values will be found from critProperties.xml
Configuration menu - View commit details
-
Copy full SHA for c3701ba - Browse repository at this point
Copy the full SHA c3701baView commit details -
[ctml2yaml/Test] Remove on-the-fly ctml_writer use
ctml_writer.py maintains global state between calling convert(). This change commits the resulting XML file into the test/data directory rather than converting during the test.
Configuration menu - View commit details
-
Copy full SHA for 96d9c17 - Browse repository at this point
Copy the full SHA 96d9c17View commit details -
[Test] Remove unnecessary enumerate
The index from the enumerate is not actually used anywhere.
Configuration menu - View commit details
-
Copy full SHA for 4d6dcce - Browse repository at this point
Copy the full SHA 4d6dcceView commit details -
[cti2yaml/Test] Remove test class setup
There isn't a reason to convert gri30 every time the class is instantiated. Move the conversion into the test_gri30 function.
Configuration menu - View commit details
-
Copy full SHA for 3ef2709 - Browse repository at this point
Copy the full SHA 3ef2709View commit details -
[ctml2yaml/Test] Reformat test file paths
Better conform to PEP-8.
Configuration menu - View commit details
-
Copy full SHA for c544d2f - Browse repository at this point
Copy the full SHA c544d2fView commit details -
[Python] Add entry point scripts for converters
The YAML converters are now installed as scripts from the Python package. The zip_safe flag is needed to ensure that data files are accessible by the package. This was added to resolve a build problem with Python 3.8. I'm not sure why it hasn't been a problem until now.
Configuration menu - View commit details
-
Copy full SHA for 4c977e4 - Browse repository at this point
Copy the full SHA 4c977e4View commit details -
[SCons/Python] Minimum Python version is 3.5
Bump the minimum Python version to 3.5 to support features in ctml2yaml.
Configuration menu - View commit details
-
Copy full SHA for 20906b6 - Browse repository at this point
Copy the full SHA 20906b6View commit details -
[cti2yaml] Update command line interface
Use argparse to have the CLI match ctml2yaml.py
Configuration menu - View commit details
-
Copy full SHA for 6508179 - Browse repository at this point
Copy the full SHA 6508179View commit details