MODULE REFERENCE

config

anomx.config

Configuration

Anomx configuration system for global options and settings.

This module provides functionality to configure global behavior of Anomx, similar to pandas' options system.

Available Options

Display Options

  • display.max_rows : int (default: 10) Maximum number of rows to display in TimeSeries representation. When a TimeSeries has more rows than this, the display will be truncated, showing the first and last portion of rows.
  • display.max_cols : int (default: 10) Maximum number of columns to display in TimeSeries representation. When a TimeSeries has more columns than this, the display will be truncated, showing the first and last portion of columns.

Plotting Options

  • plotting.use_anomx_style : bool (default: False) Whether to apply Anomx' custom plotting style to both matplotlib and plotly. When True, Anomx will configure both backends with a custom style optimized for time series visualization. When False, the default or user-configured styles will be used. Changes to this option take effect immediately.

Examples

>>> from anomx import get_option, set_option, option_context
>>> # Get current display settings
>>> get_option('display.max_rows')
10
>>> # Change display settings globally
>>> set_option('display.max_rows', 20)
>>> # Temporarily change settings within a context
>>> with option_context('display.max_rows', 5):
...     print(my_timeseries)  # Shows only 5 rows
>>> # Settings automatically restored after context
>>> get_option('display.max_rows')
20

describe_option

describe_option(pat: str) -> str

Describe one or more options.

Available Options:

  • display.[max_rows, max_cols]
  • plotting.use_anomx_style

Parameters

pat

The option key or pattern to describe. Can match multiple options. Use "all" to describe all options.

Returns

str

The description for the specified options.

Raises

ValueError

If no option matches the pattern.

Examples

>>> from anomx import describe_option
>>> describe_option('display.max_rows')
display.max_rows : int
    Maximum number of rows to display in TimeSeries representation...
    [default: 10] [currently: 10]
>>> describe_option('display')  # Describe all display options
>>> describe_option('all')  # Describe all options
Signature parameters
ParameterTypeDefault
patstrrequired

Returns str

get_option

get_option(pat: str) -> Any

Retrieves the value of the specified option.

Available Options:

  • display.[max_rows, max_cols]
  • plotting.use_anomx_style

Parameters

pat

The option key to retrieve. Must uniquely identify a single option.

Returns

Any

The current value of the option.

Raises

ValueError

If no option matches the pattern, or if the pattern is ambiguous.

Examples

>>> from anomx import get_option
>>> get_option('display.max_rows')
10
Signature parameters
ParameterTypeDefault
patstrrequired

Returns Any

option_context

option_context(*args) -> Generator[None, None, None]

Context manager to temporarily set options in the with statement context.

Available Options:

  • display.[max_rows, max_cols]
  • plotting.use_anomx_style

Parameters

*args

Pairs of (key, value) for options to set temporarily.

Yields

None

Examples

>>> from anomx import option_context, get_option
>>> get_option('display.max_rows')
10
>>> with option_context('display.max_rows', 20, 'display.max_cols', 15):
...     print(get_option('display.max_rows'))
...     print(get_option('display.max_cols'))
20
15
>>> get_option('display.max_rows')  # Back to original
10
Signature parameters
ParameterTypeDefault
*args——

Returns Generator[None, None, None]

reset_option

reset_option(pat: str) -> None

Reset one or more options to their default value.

Available Options:

  • display.[max_rows, max_cols]
  • plotting.use_anomx_style

Parameters

pat

The option key or pattern to reset. Can match multiple options. Use "all" to reset all options.

Raises

ValueError

If no option matches the pattern.

Examples

>>> from anomx import reset_option
>>> reset_option('display.max_rows')  # Reset single option
>>> reset_option('display')  # Reset all display options
>>> reset_option('all')  # Reset all options
Signature parameters
ParameterTypeDefault
patstrrequired

Returns None

set_option

set_option(pat: str, value: Any) -> None

Sets the value of the specified option.

Available Options:

  • display.[max_rows, max_cols]
  • plotting.use_anomx_style

Parameters

pat

The option key to set. Must uniquely identify a single option.

value

The new value for the option. Must be valid according to the option's validator.

Raises

ValueError

If no option matches the pattern, if the pattern is ambiguous, or if the value is invalid for the option.

Examples

>>> from anomx import set_option
>>> set_option('display.max_rows', 20)
Signature parameters
ParameterTypeDefault
patstrrequired
valueAnyrequired

Returns None