Reads NML files and converts parameters to Python data types.
Supports all standard parameters/blocks in the GLM NML file but can be expanded/updated with the type_mappings attribute.
A converted NML dictionary can be returned with the get_nml() method, or by block with get_block(), or saved directly to a JSON file with write_json().
Provides the following static methods for use with the type_mappings attribute: convert_nml_int(), convert_nml_float(), convert_nml_bool(), convert_nml_str(), convert_nml_list(), and convert_nml_array().
Package dependency "regex>=2023.12.25" added to pyproject.toml.
Adds
NMLReader
tonml.py
:type_mappings
attribute.get_nml()
method, or by block withget_block()
, or saved directly to a JSON file withwrite_json()
.type_mappings
attribute:convert_nml_int()
,convert_nml_float()
,convert_nml_bool()
,convert_nml_str()
,convert_nml_list()
, andconvert_nml_array()
."regex>=2023.12.25"
added topyproject.toml
.tests/test_nml.py