wavespectra.set_options#
- class wavespectra.set_options(**kwargs)[source]#
Set package-level options for wavespectra.
Can be used either as a function to set options globally or as a context manager to set them within a controlled block, restoring the previous values when exiting the block.
Currently supported options:
dataset_transforms: If True, methods that transform the spectral variable such asinterp,smooth,split,onedand the partitioning methods return a Dataset preserving the non-spectral variables when called from the Dataset accessor, and thewspd,wdiranddptarguments of thehp01andtrackpartitioning methods default to the dataset variables with those names. If False (default), those methods return a bare spectral DataArray and emit a FutureWarning. This will become the default behaviour in wavespectra 5.0.
Examples
>>> import wavespectra >>> wavespectra.set_options(dataset_transforms=True) # global >>> with wavespectra.set_options(dataset_transforms=True): ... dsout = dset.spec.oned() # within context only
Methods
__init__(**kwargs)