morpho.utilities.parser module

Some template vars

Members: change_and_format merge parse_args update_from_arguments

Functions:

Classes:

Definitions for parsing the CLI and updating the Toolbox configuration dictionary Authors: J. Johnston, M. Guigue, T. Weiss Date: 06/26/18

Summary

Data:

Reference

morpho.utilities.parser.parse_args()[source]

Parse the command line arguments provided to morpho :param None:

Returns:Namespace containing the arguments
Return type:namespace
morpho.utilities.parser.update_from_arguments(the_dict, args)[source]

Update a dictionary :param the_dict: Dictionary to update :param args: Dictionary to merge into the_dict

Returns:Dictionary with args merged into the_dict
Return type:dict
morpho.utilities.parser.change_and_format(b)[source]

Try to convert a string into a boolean or float :param b: String containing a boolean or float

Returns:If b == ‘True’ or ‘False’, then the corresponding boolean is returns. Otherwise, if b can be converted into a float, the float is returned. Otherwise b is returned.
Return type:bool, float, or str
morpho.utilities.parser.merge(a, b, path=None)[source]

Merge two dictionaries :param a: Base dictionary :param b: Dictionary to merge into a :param path: Location to merge b at

Returns:Merged dictionary
Return type:dict