Settings

Zero’s command line interface can be used to create, edit, remove and list the settings file.

Listing the user configuration file path

The default settings can be supplemented or overridden by a user-defined configuration file. This file is stored within the user’s home directory in a location that depends on the operating system.

The path to this file can be listed with the command zero config path.

Creating a user configuration

An empty user configuration can be created with zero config create.

Opening the user configuration for editing

The user configuration can be opened with the command zero config edit.

Removing the user configuration

The user library can be removed with zero library remove.

Showing the configuration

The combined contents of the built-in configuration and any user-defined additions or overrides can be printed to the screen with:

$ zero config show
{'algebra': {'solver': 'scipy-default'},
 'constants': {'T': 298.15},
 'data': {'noise_abs_tol': '1e-5',
          'noise_rel_tol': '1e-5',
          'response_abs_tol': '1e-4',
          'response_rel_tol': '1e-4'},
 'format': {'table': 'fancy_grid'},
 'graphviz': {'edge_arrowhead': 'dot',
              'engine': 'fdp',
              'graph_font_name': 'Helvetica',
              'graph_font_size': 8,
              'graph_splines': 'compound',
              'node_font_name': 'Helvetica',
              'node_font_size': 10,
              'node_style': 'filled'},
 'octopart': {'api_endpoint': 'https://octopart.com/api/v3/parts/match',
              'api_key': 'ebdc07fc'},
 'plot': {'alpha': 1,
          'bode': {'show_full_phase_limits': True},
          'dash_capstyle': None,
          'grid': {'alpha_major': 1, 'alpha_minor': 0.3, 'zorder': 1},
          'linestyle': None,
          'linewidth': 1.5,
          'matplotlib': {'legend.fontsize': 9},
          'size_x': 8,
          'size_y': 6,
          'sum_alpha': 0.8,
          'sum_dash_capstyle': 'round',
          'sum_greyscale_cycle_count': 4,
          'sum_greyscale_cycle_start': 1,
          'sum_greyscale_cycle_stop': 0.2,
          'sum_linestyle': '--',
          'sum_linewidth': 2,
          'sum_zorder': 3,
          'zorder': 2}}

For large configurations, it is often useful to specify the --paged flag to allow the contents to be navigated.

Styling plots

Plots generated with Matplotlib can have their style overridden by specifying commands in the plot.matplotlib section. For example, to specify the default line thickness, use the following configuration:

plot:
  matplotlib:
    lines.linewidth: 3

Refer to this Matplotlib sample configuration file for more configuration parameters.

Command reference

zero config

Zero configuration functions.

zero config [OPTIONS] COMMAND [ARGS]...

create

Create empty config file in user directory.

zero config create [OPTIONS]

edit

Open user config file in default editor.

zero config edit [OPTIONS]

path

Print user config file path.

Note: this path may not exist.

zero config path [OPTIONS]

remove

Remove user config file.

zero config remove [OPTIONS]

show

Print the config that Zero uses.

zero config show [OPTIONS]

Options

--paged

Print with paging.