kicad2ems.core.options¶
Settings as data: Option (one setting of a run, declared once in config.CORE or
by a solver) and the converters that turn a config or command-line value
into a setting.
Option('mom_dmax', 0.3,
'largest MoM cell along the copper, mm (default {default})',
float, name='dmax', gui='MoM cell (mm)', group='mom25d')
From the option lists come the Settings fields (config.Settings), the
command-line options (cli.parser), the config keys (config.read_toml: the key at
the top level, the short name under [solver.<name>]) and the GUI's form
(gui.optionrow). The analyses' settings are Options too (Analysis.options):
a pcbqs tool's table (table), a fem tool's parser (from_parser); add_arguments
makes a tool's parser of them, argv the command line of values, and
Option.describe the tool's --describe --json row.
- class kicad2ems.core.options.Option(key: str, default: object = None, help: str = '', type: str = <class 'str'>, choices: tuple = None, conv: object = None, name: str = None, gui: str = None, group: str = None, path: bool = False, cli: dict = None, level: str = None, pick: str = None, required: bool = False)[source]¶
One setting: a Settings field, a command-line option, a config key and, with `gui`, a GUI field.
- type¶
alias of
str
- kicad2ems.core.options.add_arguments(ap, options)[source]¶
Options into an argparse parser, as a tool's command line: a bool a switch, a list repeatable.
- kicad2ems.core.options.argv(options, values)[source]¶
The command-line arguments of values {option key: text, bool or list}, in their order (a key of none of the options left out): a switch when true; a list an item a flag (its conv splits a text); others when set and not the default (a value that starts with a dash joined to its flag).
- kicad2ems.core.options.floatlist(v)[source]¶
Floats from a list or a comma-separated string ('1,1.5' or [1, 1.5]); None or '' give [].
- kicad2ems.core.options.floats(n)[source]¶
n numbers: a list or a comma-separated string, as a tuple.
- kicad2ems.core.options.from_parser(parser, groups=None, pick=None)[source]¶
The Options of a tool's argparse parser: every option but the help and the output folder (a front end gives that); groups and pick: {key: its group, its pick}.
- kicad2ems.core.options.items(v)[source]¶
A list of strings that may hold commas themselves (port specs, dump specs): a list, or one string.
- kicad2ems.core.options.lines(v)[source]¶
A list's items: a list, or text an item a line or comma-separated where the next item is KEY=... (an item may hold commas: CA1=47e-6,0.02).