GLM_JSON
JSONReader
¶
Supports the reading of GLM configuration blocks in a JSON format or working with GLM configuration blocks in dictionary format.
Reads and parses a JSON file into a dictionary object which can be used to set the attributes of the corresponding NML class. Useful for converting a JSON file of GLM parameters from a web application.
Attributes:
Name | Type | Description |
---|---|---|
json_file |
str | PathLike | dict
|
The path to the json file to be read or dict representation of the nml file in memory. |
nml_file |
str
|
The path to the nml file to be written. |
Examples:
get_nml_blocks()
¶
get_nml_parameters(nml_block)
¶
Get the model parameters for a GLM configuration block.
Returns a dictionary of model parameters for a specified GLM
configuration block. Used for setting the attributes of the
corresponding nml.NML*
classes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nml_block |
str
|
The name of the GLM configuration block |
required |
Returns:
Type | Description |
---|---|
dict
|
A dictionary of the model parameters for a specified GLM configuration block. |
Examples: