Settings#
Package settings#
spm1d.settings sets package-wide behavior including especially: warnings and progress bars. For example, all spm1d warnings can be enabled/disabled with:
spm1d.settings.enable_warnings( False )
- class SPM1DSettings[source]#
Package settings (
spm1d.settings).- timer_on#
True if procedure timing is printed (
enable_timer).
- warnings_on#
True if
SPM1DUserWarningandSPM1DDeprecationWarningare shown (enable_warnings).
- progress_on#
True if progress bars are shown (
enable_progress).
- spm12_on#
True if SPM12 rules replace spm1d rules (
enable_spm12_compatibility).
- enable_progress(b=True)[source]#
Toggle progress bars.
- Parameters:
b — True (default) to enable, False to disable
- Returns:
None
- Example:
>>> import spm1d >>> spm1d.settings.enable_progress( False )
- enable_spm12_compatibility(b=True)[source]#
Reproduce SPM12 where spm1d departs from it (off by default).
Affects two calculations:
0D two-sample t: residual-field degrees of freedom trRV**2/trRVRV instead of Welch’s degrees of freedom.
1D covariance estimate: each node is scaled to unit residual variance before pooling.
- Parameters:
b — True (default) to enable, False to disable
- Returns:
None
- Example:
>>> import spm1d >>> spm1d.settings.enable_spm12_compatibility() >>> spm1d.settings.enable_spm12_compatibility( False )
- enable_timer(b=True)[source]#
Toggle procedure timing printouts.
- Parameters:
b — True (default) to enable, False to disable
- Returns:
None
- Example:
>>> import spm1d >>> spm1d.settings.enable_timer() >>> spm1d.settings.enable_timer( False )
System configuration for bug reports#
To facilitate bug reporting, spm1d.get_config() collects the versions of spm1d and its main dependencies that you are using.
- get_config(packages=None)[source]#
Versions and platform for bug report submission.
- Parameters:
packages — sequence of additional package names to report (default None)
- Returns:
Config object.
- Example:
>>> import spm1d >>> print( spm1d.get_config() ) spm1d 0.5.0 rft1d 0.2.8 numpy 2.1.0 scipy 1.14.0 matplotlib 3.9.0 python 3.12.4 (CPython) platform macOS-15.1-arm64-arm-64bit install installed
- class Config[source]#
Snapshot of dependency versions and platform.
- names#
Reported package names in order.
- packages#
Version string per package name (
"not installed"if absent).
- python#
Python version and implementation.
- platform#
Operating system and machine.
- install#
"installed"(site-packages) or"source"(checkout).