gwexpy 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gwexpy/__init__.py +224 -0
- gwexpy/_bootstrap.py +59 -0
- gwexpy/_version.py +3 -0
- gwexpy/_warnings.py +50 -0
- gwexpy/analysis/__init__.py +39 -0
- gwexpy/analysis/bruco.py +1746 -0
- gwexpy/analysis/coupling.py +1034 -0
- gwexpy/analysis/coupling_result.py +1155 -0
- gwexpy/analysis/response.py +999 -0
- gwexpy/analysis/stat_info.py +103 -0
- gwexpy/analysis/stats.py +52 -0
- gwexpy/analysis/threshold.py +409 -0
- gwexpy/astro/__init__.py +14 -0
- gwexpy/astro/range.py +28 -0
- gwexpy/cli/__init__.py +58 -0
- gwexpy/cli/__main__.py +6 -0
- gwexpy/cli/cliproduct.py +42 -0
- gwexpy/cli/coherence.py +12 -0
- gwexpy/cli/coherencegram.py +10 -0
- gwexpy/cli/gwpy_plot.py +5 -0
- gwexpy/cli/qtransform.py +18 -0
- gwexpy/cli/spectrogram.py +15 -0
- gwexpy/cli/spectrum.py +15 -0
- gwexpy/cli/timeseries.py +13 -0
- gwexpy/cli/transferfunction.py +15 -0
- gwexpy/detector/__init__.py +14 -0
- gwexpy/detector/channel.py +23 -0
- gwexpy/detector/io/__init__.py +9 -0
- gwexpy/detector/io/cis.py +15 -0
- gwexpy/detector/io/clf.py +17 -0
- gwexpy/detector/io/omega.py +15 -0
- gwexpy/detector/units.py +21 -0
- gwexpy/fields/__init__.py +46 -0
- gwexpy/fields/base.py +540 -0
- gwexpy/fields/collections.py +307 -0
- gwexpy/fields/demo.py +315 -0
- gwexpy/fields/scalar.py +2303 -0
- gwexpy/fields/signal.py +1533 -0
- gwexpy/fields/tensor.py +464 -0
- gwexpy/fields/vector.py +387 -0
- gwexpy/fitting/__init__.py +83 -0
- gwexpy/fitting/core.py +1245 -0
- gwexpy/fitting/gls.py +183 -0
- gwexpy/fitting/highlevel.py +363 -0
- gwexpy/fitting/mixin.py +59 -0
- gwexpy/fitting/models.py +255 -0
- gwexpy/frequencyseries/__init__.py +32 -0
- gwexpy/frequencyseries/_fdcommon.py +1 -0
- gwexpy/frequencyseries/bifrequencymap.py +876 -0
- gwexpy/frequencyseries/collections.py +1099 -0
- gwexpy/frequencyseries/frequencyseries.py +1686 -0
- gwexpy/frequencyseries/hist.py +1 -0
- gwexpy/frequencyseries/io/__init__.py +9 -0
- gwexpy/frequencyseries/io/ascii.py +6 -0
- gwexpy/frequencyseries/io/dttxml.py +258 -0
- gwexpy/frequencyseries/io/hdf5.py +6 -0
- gwexpy/frequencyseries/io/ligolw.py +1 -0
- gwexpy/frequencyseries/io/stubs.py +38 -0
- gwexpy/frequencyseries/matrix.py +145 -0
- gwexpy/frequencyseries/matrix_analysis.py +197 -0
- gwexpy/frequencyseries/matrix_core.py +95 -0
- gwexpy/histogram/__init__.py +18 -0
- gwexpy/histogram/_core.py +415 -0
- gwexpy/histogram/_rebin.py +260 -0
- gwexpy/histogram/_typing.py +40 -0
- gwexpy/histogram/collections.py +436 -0
- gwexpy/histogram/histogram.py +395 -0
- gwexpy/histogram/io/__init__.py +1 -0
- gwexpy/histogram/io/_hdf5.py +104 -0
- gwexpy/interop/__init__.py +305 -0
- gwexpy/interop/_modal_helpers.py +215 -0
- gwexpy/interop/_optional.py +194 -0
- gwexpy/interop/_registry.py +142 -0
- gwexpy/interop/_time.py +98 -0
- gwexpy/interop/astropy_.py +39 -0
- gwexpy/interop/base.py +34 -0
- gwexpy/interop/control_.py +227 -0
- gwexpy/interop/cupy_.py +42 -0
- gwexpy/interop/dask_.py +39 -0
- gwexpy/interop/emg3d_.py +494 -0
- gwexpy/interop/errors.py +38 -0
- gwexpy/interop/exudyn_.py +123 -0
- gwexpy/interop/finesse_.py +280 -0
- gwexpy/interop/frequency.py +184 -0
- gwexpy/interop/gwinc_.py +200 -0
- gwexpy/interop/harmonica_.py +93 -0
- gwexpy/interop/hdf5_.py +69 -0
- gwexpy/interop/jax_.py +24 -0
- gwexpy/interop/json_.py +47 -0
- gwexpy/interop/lal_.py +221 -0
- gwexpy/interop/meep_.py +322 -0
- gwexpy/interop/meshio_.py +369 -0
- gwexpy/interop/metpy_.py +90 -0
- gwexpy/interop/mne_.py +490 -0
- gwexpy/interop/mt_.py +274 -0
- gwexpy/interop/multitaper_.py +277 -0
- gwexpy/interop/neo_.py +107 -0
- gwexpy/interop/netcdf4_.py +62 -0
- gwexpy/interop/obspy_.py +300 -0
- gwexpy/interop/openems_.py +405 -0
- gwexpy/interop/opensees_.py +133 -0
- gwexpy/interop/pandas_.py +228 -0
- gwexpy/interop/polars_.py +232 -0
- gwexpy/interop/pycbc_.py +184 -0
- gwexpy/interop/pydub_.py +69 -0
- gwexpy/interop/pyoma_.py +97 -0
- gwexpy/interop/pyroomacoustics_.py +578 -0
- gwexpy/interop/pyspeckit_.py +69 -0
- gwexpy/interop/pyspice_.py +331 -0
- gwexpy/interop/quantities_.py +110 -0
- gwexpy/interop/root_.py +544 -0
- gwexpy/interop/sdynpy_.py +231 -0
- gwexpy/interop/sdypy_.py +141 -0
- gwexpy/interop/simpeg_.py +202 -0
- gwexpy/interop/skrf_.py +524 -0
- gwexpy/interop/specutils_.py +88 -0
- gwexpy/interop/sqlite_.py +92 -0
- gwexpy/interop/tensorflow_.py +22 -0
- gwexpy/interop/torch_.py +100 -0
- gwexpy/interop/torch_dataset.py +167 -0
- gwexpy/interop/wrf_.py +133 -0
- gwexpy/interop/xarray_.py +364 -0
- gwexpy/interop/zarr_.py +75 -0
- gwexpy/io/__init__.py +20 -0
- gwexpy/io/_framecpp.py +12 -0
- gwexpy/io/cache.py +14 -0
- gwexpy/io/collection_dir.py +165 -0
- gwexpy/io/datafind.py +19 -0
- gwexpy/io/dttxml_common.py +597 -0
- gwexpy/io/ffldatafind.py +22 -0
- gwexpy/io/gwf.py +20 -0
- gwexpy/io/hdf5.py +10 -0
- gwexpy/io/hdf5_collection.py +121 -0
- gwexpy/io/kerberos.py +6 -0
- gwexpy/io/ligolw.py +35 -0
- gwexpy/io/nds2.py +14 -0
- gwexpy/io/pickle_compat.py +88 -0
- gwexpy/io/registry.py +22 -0
- gwexpy/io/utils.py +297 -0
- gwexpy/noise/__init__.py +55 -0
- gwexpy/noise/asd.py +58 -0
- gwexpy/noise/colored.py +171 -0
- gwexpy/noise/field.py +202 -0
- gwexpy/noise/gwinc_.py +183 -0
- gwexpy/noise/line_mask.py +66 -0
- gwexpy/noise/magnetic.py +141 -0
- gwexpy/noise/non_gaussian.py +238 -0
- gwexpy/noise/obspy_.py +261 -0
- gwexpy/noise/peaks.py +166 -0
- gwexpy/noise/wave.py +956 -0
- gwexpy/numerics/__init__.py +38 -0
- gwexpy/numerics/constants.py +97 -0
- gwexpy/numerics/scaling.py +169 -0
- gwexpy/plot/__init__.py +48 -0
- gwexpy/plot/_coord.py +261 -0
- gwexpy/plot/_init_helpers.py +499 -0
- gwexpy/plot/_label_utils.py +50 -0
- gwexpy/plot/axes.py +25 -0
- gwexpy/plot/bode.py +6 -0
- gwexpy/plot/colorbar.py +14 -0
- gwexpy/plot/colors.py +17 -0
- gwexpy/plot/defaults.py +382 -0
- gwexpy/plot/field.py +222 -0
- gwexpy/plot/gauch_dashboard.py +121 -0
- gwexpy/plot/geomap.py +217 -0
- gwexpy/plot/gps.py +31 -0
- gwexpy/plot/legend.py +8 -0
- gwexpy/plot/log.py +17 -0
- gwexpy/plot/pairplot.py +248 -0
- gwexpy/plot/plot.py +554 -0
- gwexpy/plot/rc.py +20 -0
- gwexpy/plot/segments.py +22 -0
- gwexpy/plot/skymap.py +188 -0
- gwexpy/plot/tex.py +1 -0
- gwexpy/plot/text.py +1 -0
- gwexpy/plot/units.py +9 -0
- gwexpy/plot/utils.py +71 -0
- gwexpy/py.typed +0 -0
- gwexpy/segments/__init__.py +14 -0
- gwexpy/segments/flag.py +6 -0
- gwexpy/segments/io/__init__.py +10 -0
- gwexpy/segments/io/hdf5.py +6 -0
- gwexpy/segments/io/json.py +12 -0
- gwexpy/segments/io/ligolw.py +20 -0
- gwexpy/segments/io/segwizard.py +17 -0
- gwexpy/segments/segments.py +4 -0
- gwexpy/signal/__init__.py +49 -0
- gwexpy/signal/fft.py +6 -0
- gwexpy/signal/filter_design.py +4 -0
- gwexpy/signal/normalization.py +153 -0
- gwexpy/signal/preprocessing/__init__.py +16 -0
- gwexpy/signal/preprocessing/imputation.py +282 -0
- gwexpy/signal/preprocessing/ml.py +388 -0
- gwexpy/signal/preprocessing/standardization.py +114 -0
- gwexpy/signal/preprocessing/whitening.py +174 -0
- gwexpy/signal/qtransform.py +10 -0
- gwexpy/signal/spectral/__init__.py +18 -0
- gwexpy/signal/spectral/_lal.py +27 -0
- gwexpy/signal/spectral/_median_mean.py +1 -0
- gwexpy/signal/spectral/_pycbc.py +1 -0
- gwexpy/signal/spectral/_registry.py +1 -0
- gwexpy/signal/spectral/_scipy.py +21 -0
- gwexpy/signal/spectral/_ui.py +23 -0
- gwexpy/signal/spectral/_utils.py +1 -0
- gwexpy/signal/window.py +4 -0
- gwexpy/spectral/__init__.py +13 -0
- gwexpy/spectral/estimation.py +762 -0
- gwexpy/spectrogram/__init__.py +33 -0
- gwexpy/spectrogram/cleaning.py +154 -0
- gwexpy/spectrogram/coherence.py +11 -0
- gwexpy/spectrogram/collections.py +948 -0
- gwexpy/spectrogram/io/__init__.py +8 -0
- gwexpy/spectrogram/io/hdf5.py +6 -0
- gwexpy/spectrogram/matrix.py +849 -0
- gwexpy/spectrogram/matrix_analysis.py +131 -0
- gwexpy/spectrogram/matrix_core.py +194 -0
- gwexpy/spectrogram/spectrogram.py +1029 -0
- gwexpy/statistics/__init__.py +15 -0
- gwexpy/statistics/dq_flag.py +82 -0
- gwexpy/statistics/gauch.py +149 -0
- gwexpy/statistics/rayleigh_test.py +95 -0
- gwexpy/statistics/roc.py +85 -0
- gwexpy/statistics/student_t_indicator.py +124 -0
- gwexpy/table/__init__.py +25 -0
- gwexpy/table/filter.py +39 -0
- gwexpy/table/filters.py +13 -0
- gwexpy/table/gravityspy.py +35 -0
- gwexpy/table/io/__init__.py +37 -0
- gwexpy/table/io/cwb.py +23 -0
- gwexpy/table/io/fetch.py +17 -0
- gwexpy/table/io/gravityspy.py +11 -0
- gwexpy/table/io/gstlal.py +47 -0
- gwexpy/table/io/gwf.py +27 -0
- gwexpy/table/io/hacr.py +39 -0
- gwexpy/table/io/ligolw.py +47 -0
- gwexpy/table/io/losc.py +33 -0
- gwexpy/table/io/omega.py +21 -0
- gwexpy/table/io/omicron.py +13 -0
- gwexpy/table/io/pycbc.py +47 -0
- gwexpy/table/io/root.py +27 -0
- gwexpy/table/io/snax.py +25 -0
- gwexpy/table/io/sql.py +17 -0
- gwexpy/table/io/utils.py +21 -0
- gwexpy/table/segment_cell.py +117 -0
- gwexpy/table/segment_plot.py +551 -0
- gwexpy/table/segment_table.py +1118 -0
- gwexpy/table/table.py +35 -0
- gwexpy/time/__init__.py +21 -0
- gwexpy/time/__main__.py +19 -0
- gwexpy/time/_tconvert.py +29 -0
- gwexpy/time/core.py +185 -0
- gwexpy/timeseries/__init__.py +57 -0
- gwexpy/timeseries/_analysis.py +411 -0
- gwexpy/timeseries/_core.py +100 -0
- gwexpy/timeseries/_gwf_io.py +243 -0
- gwexpy/timeseries/_interop.py +1191 -0
- gwexpy/timeseries/_resampling.py +822 -0
- gwexpy/timeseries/_signal.py +1573 -0
- gwexpy/timeseries/_spectral.py +23 -0
- gwexpy/timeseries/_spectral_fourier.py +580 -0
- gwexpy/timeseries/_spectral_special.py +1672 -0
- gwexpy/timeseries/_statistics.py +732 -0
- gwexpy/timeseries/_timeseries_legacy.py +41 -0
- gwexpy/timeseries/_typing.py +69 -0
- gwexpy/timeseries/arima.py +473 -0
- gwexpy/timeseries/collections.py +1981 -0
- gwexpy/timeseries/core.py +41 -0
- gwexpy/timeseries/decomposition.py +708 -0
- gwexpy/timeseries/hurst.py +362 -0
- gwexpy/timeseries/io/__init__.py +31 -0
- gwexpy/timeseries/io/_registration.py +290 -0
- gwexpy/timeseries/io/ascii.py +13 -0
- gwexpy/timeseries/io/ats.py +337 -0
- gwexpy/timeseries/io/audio.py +267 -0
- gwexpy/timeseries/io/cache.py +11 -0
- gwexpy/timeseries/io/core.py +13 -0
- gwexpy/timeseries/io/csv_config.py +133 -0
- gwexpy/timeseries/io/csv_enhanced.py +463 -0
- gwexpy/timeseries/io/dttxml.py +133 -0
- gwexpy/timeseries/io/gbd.py +441 -0
- gwexpy/timeseries/io/gwf/__init__.py +51 -0
- gwexpy/timeseries/io/gwf/framecpp.py +11 -0
- gwexpy/timeseries/io/gwf/framel.py +25 -0
- gwexpy/timeseries/io/gwf/lalframe.py +11 -0
- gwexpy/timeseries/io/hdf5.py +45 -0
- gwexpy/timeseries/io/losc.py +11 -0
- gwexpy/timeseries/io/nds2.py +29 -0
- gwexpy/timeseries/io/ndscope_hdf5.py +274 -0
- gwexpy/timeseries/io/netcdf4_.py +409 -0
- gwexpy/timeseries/io/sdb.py +175 -0
- gwexpy/timeseries/io/seismic.py +270 -0
- gwexpy/timeseries/io/stubs.py +32 -0
- gwexpy/timeseries/io/tdms.py +160 -0
- gwexpy/timeseries/io/wav.py +149 -0
- gwexpy/timeseries/io/win.py +244 -0
- gwexpy/timeseries/io/zarr_.py +256 -0
- gwexpy/timeseries/matrix.py +360 -0
- gwexpy/timeseries/matrix_analysis.py +919 -0
- gwexpy/timeseries/matrix_core.py +495 -0
- gwexpy/timeseries/matrix_interop.py +50 -0
- gwexpy/timeseries/matrix_spectral.py +415 -0
- gwexpy/timeseries/pipeline.py +617 -0
- gwexpy/timeseries/preprocess.py +1437 -0
- gwexpy/timeseries/rolling.py +362 -0
- gwexpy/timeseries/spectral.py +319 -0
- gwexpy/timeseries/statevector.py +8 -0
- gwexpy/timeseries/timeseries.py +431 -0
- gwexpy/timeseries/utils.py +371 -0
- gwexpy/types/__init__.py +75 -0
- gwexpy/types/_stats.py +269 -0
- gwexpy/types/array.py +82 -0
- gwexpy/types/array2d.py +137 -0
- gwexpy/types/array3d.py +315 -0
- gwexpy/types/array4d.py +444 -0
- gwexpy/types/axis.py +125 -0
- gwexpy/types/axis_api.py +261 -0
- gwexpy/types/hht_spectrogram.py +130 -0
- gwexpy/types/index.py +13 -0
- gwexpy/types/io/__init__.py +13 -0
- gwexpy/types/io/ascii.py +25 -0
- gwexpy/types/io/hdf5.py +45 -0
- gwexpy/types/io/ligolw.py +17 -0
- gwexpy/types/metadata.py +939 -0
- gwexpy/types/mixin/__init__.py +27 -0
- gwexpy/types/mixin/_collection_mixin.py +156 -0
- gwexpy/types/mixin/_plot_mixin.py +19 -0
- gwexpy/types/mixin/_protocols.py +228 -0
- gwexpy/types/mixin/mixin_legacy.py +90 -0
- gwexpy/types/mixin/signal_interop.py +326 -0
- gwexpy/types/plane2d.py +86 -0
- gwexpy/types/series.py +17 -0
- gwexpy/types/series_creator.py +156 -0
- gwexpy/types/series_matrix_analysis.py +389 -0
- gwexpy/types/series_matrix_core.py +328 -0
- gwexpy/types/series_matrix_indexing.py +275 -0
- gwexpy/types/series_matrix_io.py +387 -0
- gwexpy/types/series_matrix_math.py +566 -0
- gwexpy/types/series_matrix_structure.py +222 -0
- gwexpy/types/series_matrix_validation_mixin.py +186 -0
- gwexpy/types/series_matrix_visualization.py +14 -0
- gwexpy/types/seriesmatrix.py +29 -0
- gwexpy/types/seriesmatrix_base.py +608 -0
- gwexpy/types/seriesmatrix_validation.py +943 -0
- gwexpy/types/sliceutils.py +17 -0
- gwexpy/types/time_plane_transform.py +410 -0
- gwexpy/types/typing.py +190 -0
- gwexpy/utils/__init__.py +9 -0
- gwexpy/utils/decorators.py +17 -0
- gwexpy/utils/enum.py +11 -0
- gwexpy/utils/env.py +11 -0
- gwexpy/utils/fft_args.py +332 -0
- gwexpy/utils/lal.py +39 -0
- gwexpy/utils/logger.py +18 -0
- gwexpy/utils/misc.py +11 -0
- gwexpy/utils/mp.py +13 -0
- gwexpy/utils/progress.py +13 -0
- gwexpy/utils/shell.py +19 -0
- gwexpy/utils/units.py +191 -0
- gwexpy-0.1.1.dist-info/METADATA +203 -0
- gwexpy-0.1.1.dist-info/RECORD +364 -0
- gwexpy-0.1.1.dist-info/WHEEL +5 -0
- gwexpy-0.1.1.dist-info/entry_points.txt +2 -0
- gwexpy-0.1.1.dist-info/licenses/LICENSE.txt +21 -0
- gwexpy-0.1.1.dist-info/top_level.txt +1 -0
gwexpy/__init__.py
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"""gwexpy: GWpy Expansions for Experiments.
|
|
2
|
+
|
|
3
|
+
This package extends GWpy with additional functionality for
|
|
4
|
+
gravitational wave and time-series data analysis.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import warnings
|
|
9
|
+
from typing import TYPE_CHECKING, Any
|
|
10
|
+
|
|
11
|
+
from astropy.utils.exceptions import AstropyWarning
|
|
12
|
+
|
|
13
|
+
from . import _warnings # noqa: F401 – registers package-level warning filters
|
|
14
|
+
|
|
15
|
+
# Keep docs/tutorial output readable by suppressing known noisy warnings.
|
|
16
|
+
# This must run before importing GWpy/LAL (which can emit warnings at import time).
|
|
17
|
+
warnings.filterwarnings("ignore", "Wswiglal-redir-stdio")
|
|
18
|
+
|
|
19
|
+
# -----------------------------------------------------------------------------
|
|
20
|
+
# Compatibility: some minimal or newer gwpy builds used in docs/CI may lack
|
|
21
|
+
# `gwpy.io.registry.register_reader` / `register_identifier` / `register_writer`.
|
|
22
|
+
# Ensure the attributes exist so our IO modules' registration calls don't
|
|
23
|
+
# explode during import in stripped-down environments.
|
|
24
|
+
# -----------------------------------------------------------------------------
|
|
25
|
+
try: # pragma: no cover - defensive
|
|
26
|
+
import gwpy.io as _gwpy_io
|
|
27
|
+
|
|
28
|
+
_io_reg = getattr(_gwpy_io, "registry", None)
|
|
29
|
+
if _io_reg is not None:
|
|
30
|
+
|
|
31
|
+
def _noop(*_args, **_kwargs):
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
for _name in ("register_reader", "register_identifier", "register_writer"):
|
|
35
|
+
if not hasattr(_io_reg, _name):
|
|
36
|
+
setattr(_io_reg, _name, _noop) # type: ignore[attr-defined]
|
|
37
|
+
except (ImportError, AttributeError):
|
|
38
|
+
pass
|
|
39
|
+
|
|
40
|
+
warnings.filterwarnings(
|
|
41
|
+
"ignore",
|
|
42
|
+
message=r"xindex was given to .*\(\), x0 will be ignored",
|
|
43
|
+
category=UserWarning,
|
|
44
|
+
module="gwpy",
|
|
45
|
+
)
|
|
46
|
+
warnings.filterwarnings(
|
|
47
|
+
"ignore",
|
|
48
|
+
message=r"xindex was given to .*\(\), dx will be ignored",
|
|
49
|
+
category=UserWarning,
|
|
50
|
+
module="gwpy",
|
|
51
|
+
)
|
|
52
|
+
warnings.filterwarnings(
|
|
53
|
+
"ignore",
|
|
54
|
+
message=r"yindex was given to .*\(\), dy will be ignored",
|
|
55
|
+
category=UserWarning,
|
|
56
|
+
module="gwpy",
|
|
57
|
+
)
|
|
58
|
+
warnings.filterwarnings("ignore", category=AstropyWarning)
|
|
59
|
+
warnings.filterwarnings("ignore", category=FutureWarning, module="sklearn")
|
|
60
|
+
warnings.filterwarnings("ignore", category=FutureWarning, module="control")
|
|
61
|
+
warnings.filterwarnings(
|
|
62
|
+
"ignore", message="Protobuf gencode version", category=UserWarning
|
|
63
|
+
)
|
|
64
|
+
warnings.filterwarnings(
|
|
65
|
+
"ignore",
|
|
66
|
+
message=r"pkg_resources is deprecated as an API\..*",
|
|
67
|
+
category=UserWarning,
|
|
68
|
+
)
|
|
69
|
+
warnings.filterwarnings(
|
|
70
|
+
"ignore",
|
|
71
|
+
message=r".*joblib will operate in serial mode.*",
|
|
72
|
+
category=UserWarning,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# Subpackages are available via namespace
|
|
76
|
+
from . import (
|
|
77
|
+
astro,
|
|
78
|
+
detector,
|
|
79
|
+
frequencyseries,
|
|
80
|
+
histogram,
|
|
81
|
+
interop,
|
|
82
|
+
io,
|
|
83
|
+
noise,
|
|
84
|
+
plot,
|
|
85
|
+
segments,
|
|
86
|
+
signal,
|
|
87
|
+
spectral,
|
|
88
|
+
spectrogram,
|
|
89
|
+
table,
|
|
90
|
+
time,
|
|
91
|
+
timeseries,
|
|
92
|
+
types,
|
|
93
|
+
)
|
|
94
|
+
from ._bootstrap import register_all
|
|
95
|
+
from ._version import __version__
|
|
96
|
+
from .fields import FieldDict, FieldList, ScalarField, TensorField, VectorField
|
|
97
|
+
from .frequencyseries import (
|
|
98
|
+
FrequencySeries,
|
|
99
|
+
FrequencySeriesDict,
|
|
100
|
+
FrequencySeriesList,
|
|
101
|
+
FrequencySeriesMatrix,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
# Histogram types
|
|
105
|
+
from .histogram import (
|
|
106
|
+
Histogram,
|
|
107
|
+
HistogramDict,
|
|
108
|
+
HistogramList,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
# Signal processing utilities
|
|
112
|
+
from .signal.preprocessing import (
|
|
113
|
+
StandardizationModel,
|
|
114
|
+
WhiteningModel,
|
|
115
|
+
impute,
|
|
116
|
+
standardize,
|
|
117
|
+
whiten,
|
|
118
|
+
)
|
|
119
|
+
from .spectrogram import (
|
|
120
|
+
Spectrogram,
|
|
121
|
+
SpectrogramDict,
|
|
122
|
+
SpectrogramList,
|
|
123
|
+
SpectrogramMatrix,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# Core data types - explicitly imported for IDE support and clear API
|
|
127
|
+
from .timeseries import (
|
|
128
|
+
TimeSeries,
|
|
129
|
+
TimeSeriesDict,
|
|
130
|
+
TimeSeriesList,
|
|
131
|
+
TimeSeriesMatrix,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
# Types
|
|
135
|
+
from .types import (
|
|
136
|
+
MetaData,
|
|
137
|
+
MetaDataDict,
|
|
138
|
+
MetaDataMatrix,
|
|
139
|
+
SeriesMatrix,
|
|
140
|
+
as_series,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
__all__ = [
|
|
144
|
+
# Bootstrap
|
|
145
|
+
"register_all",
|
|
146
|
+
# Version
|
|
147
|
+
"__version__",
|
|
148
|
+
# TimeSeries types
|
|
149
|
+
"TimeSeries",
|
|
150
|
+
"TimeSeriesDict",
|
|
151
|
+
"TimeSeriesList",
|
|
152
|
+
"TimeSeriesMatrix",
|
|
153
|
+
# FrequencySeries types
|
|
154
|
+
"FrequencySeries",
|
|
155
|
+
"FrequencySeriesDict",
|
|
156
|
+
"FrequencySeriesList",
|
|
157
|
+
"FrequencySeriesMatrix",
|
|
158
|
+
# Spectrogram types
|
|
159
|
+
"Spectrogram",
|
|
160
|
+
"SpectrogramList",
|
|
161
|
+
"SpectrogramDict",
|
|
162
|
+
"SpectrogramMatrix",
|
|
163
|
+
# Histogram types
|
|
164
|
+
"Histogram",
|
|
165
|
+
"HistogramDict",
|
|
166
|
+
"HistogramList",
|
|
167
|
+
# Types
|
|
168
|
+
"ScalarField",
|
|
169
|
+
"VectorField",
|
|
170
|
+
"TensorField",
|
|
171
|
+
"FieldList",
|
|
172
|
+
"FieldDict",
|
|
173
|
+
"SeriesMatrix",
|
|
174
|
+
"MetaData",
|
|
175
|
+
"MetaDataDict",
|
|
176
|
+
"MetaDataMatrix",
|
|
177
|
+
"as_series",
|
|
178
|
+
# Signal preprocessing
|
|
179
|
+
"whiten",
|
|
180
|
+
"standardize",
|
|
181
|
+
"impute",
|
|
182
|
+
"WhiteningModel",
|
|
183
|
+
"StandardizationModel",
|
|
184
|
+
# Subpackages
|
|
185
|
+
"timeseries",
|
|
186
|
+
"frequencyseries",
|
|
187
|
+
"histogram",
|
|
188
|
+
"spectrogram",
|
|
189
|
+
"spectral",
|
|
190
|
+
"astro",
|
|
191
|
+
"detector",
|
|
192
|
+
"plot",
|
|
193
|
+
"segments",
|
|
194
|
+
"signal",
|
|
195
|
+
"table",
|
|
196
|
+
"time",
|
|
197
|
+
"types",
|
|
198
|
+
"io",
|
|
199
|
+
"interop",
|
|
200
|
+
"noise",
|
|
201
|
+
"fitting",
|
|
202
|
+
]
|
|
203
|
+
|
|
204
|
+
if TYPE_CHECKING: # pragma: no cover
|
|
205
|
+
import gwexpy.fitting as fitting
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def __getattr__(name: str) -> Any:
|
|
209
|
+
if name == "fitting":
|
|
210
|
+
import importlib
|
|
211
|
+
|
|
212
|
+
mod = importlib.import_module(".fitting", __name__)
|
|
213
|
+
globals()["fitting"] = mod
|
|
214
|
+
return mod
|
|
215
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def __dir__() -> list[str]:
|
|
219
|
+
return sorted(set(__all__) | set(globals().keys()))
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
# Mark bootstrap as complete — all subpackages have been imported above,
|
|
223
|
+
# so the registry is fully populated.
|
|
224
|
+
register_all()
|
gwexpy/_bootstrap.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""Explicit bootstrap for gwexpy registry initialization.
|
|
2
|
+
|
|
3
|
+
Normally, ``import gwexpy`` eagerly imports all subpackages, which triggers
|
|
4
|
+
constructor and I/O format registration as a side effect. However, if a
|
|
5
|
+
user or tool imports a submodule directly (e.g.,
|
|
6
|
+
``from gwexpy.interop._registry import ConverterRegistry``), registrations
|
|
7
|
+
from other subpackages will not have run yet.
|
|
8
|
+
|
|
9
|
+
``register_all()`` forces all subpackage imports so the registry is fully
|
|
10
|
+
populated regardless of import order.
|
|
11
|
+
|
|
12
|
+
Examples
|
|
13
|
+
--------
|
|
14
|
+
>>> from gwexpy import register_all
|
|
15
|
+
>>> register_all()
|
|
16
|
+
|
|
17
|
+
>>> # Or equivalently, just import the top-level package:
|
|
18
|
+
>>> import gwexpy # register_all() is called automatically
|
|
19
|
+
|
|
20
|
+
"""
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
_bootstrapped = False
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def register_all(*, include_io: bool = True) -> None:
|
|
27
|
+
"""Ensure all constructors and (optionally) I/O formats are registered.
|
|
28
|
+
|
|
29
|
+
This function is idempotent — calling it multiple times is safe and
|
|
30
|
+
effectively free after the first call.
|
|
31
|
+
|
|
32
|
+
Parameters
|
|
33
|
+
----------
|
|
34
|
+
include_io : bool, optional
|
|
35
|
+
If ``True`` (default), also trigger I/O format registration
|
|
36
|
+
(readers, writers, identifiers). Set to ``False`` to register
|
|
37
|
+
only constructors.
|
|
38
|
+
|
|
39
|
+
"""
|
|
40
|
+
global _bootstrapped
|
|
41
|
+
if _bootstrapped:
|
|
42
|
+
return
|
|
43
|
+
|
|
44
|
+
# Force-import subpackages that register constructors.
|
|
45
|
+
# Python caches modules, so repeated imports are no-ops.
|
|
46
|
+
import gwexpy.frequencyseries # noqa: F811
|
|
47
|
+
import gwexpy.histogram # noqa: F811
|
|
48
|
+
import gwexpy.plot # noqa: F811
|
|
49
|
+
import gwexpy.spectrogram # noqa: F811
|
|
50
|
+
import gwexpy.timeseries # noqa: F811
|
|
51
|
+
import gwexpy.types # noqa: F811
|
|
52
|
+
|
|
53
|
+
if include_io:
|
|
54
|
+
# frequencyseries/__init__.py does not import .io,
|
|
55
|
+
# so we must trigger it explicitly here.
|
|
56
|
+
import gwexpy.frequencyseries.io # noqa: F401
|
|
57
|
+
import gwexpy.timeseries.io # noqa: F401
|
|
58
|
+
|
|
59
|
+
_bootstrapped = True
|
gwexpy/_version.py
ADDED
gwexpy/_warnings.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""gwexpy._warnings - Package-level warning filters.
|
|
2
|
+
|
|
3
|
+
Suppresses noisy warnings from external libraries (gwpy, LAL, matplotlib)
|
|
4
|
+
that are irrelevant to end-users. Filters are registered once at import time.
|
|
5
|
+
|
|
6
|
+
Only warnings that carry no actionable information for the user are suppressed
|
|
7
|
+
here. Warnings that indicate potential issues with user data or parameters are
|
|
8
|
+
left in place (with appropriate stacklevel so they point to user code).
|
|
9
|
+
"""
|
|
10
|
+
from __future__ import annotations
|
|
11
|
+
|
|
12
|
+
import warnings
|
|
13
|
+
|
|
14
|
+
# ---------------------------------------------------------------------------
|
|
15
|
+
# LAL / gwpy initialisation noise
|
|
16
|
+
# ---------------------------------------------------------------------------
|
|
17
|
+
# Emitted by lal when its stdio redirection is activated. No user action needed.
|
|
18
|
+
warnings.filterwarnings(
|
|
19
|
+
"ignore",
|
|
20
|
+
message="Wswiglal-redir-stdio",
|
|
21
|
+
category=UserWarning,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# ---------------------------------------------------------------------------
|
|
25
|
+
# matplotlib backend warnings
|
|
26
|
+
# ---------------------------------------------------------------------------
|
|
27
|
+
# Fired when show() is called in a non-interactive backend (e.g. Agg in CI).
|
|
28
|
+
warnings.filterwarnings(
|
|
29
|
+
"ignore",
|
|
30
|
+
message="FigureCanvasAgg is non-interactive",
|
|
31
|
+
category=UserWarning,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
# ---------------------------------------------------------------------------
|
|
35
|
+
# gwpy / matplotlib axis warnings
|
|
36
|
+
# ---------------------------------------------------------------------------
|
|
37
|
+
# Fired when a log-scaled axis receives a non-positive limit – handled
|
|
38
|
+
# internally by matplotlib and has no effect on the output.
|
|
39
|
+
warnings.filterwarnings(
|
|
40
|
+
"ignore",
|
|
41
|
+
message="Attempt to set non-positive",
|
|
42
|
+
category=UserWarning,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
# Fired when a legend is requested but no labelled artists exist. Harmless.
|
|
46
|
+
warnings.filterwarnings(
|
|
47
|
+
"ignore",
|
|
48
|
+
message="No artists with labels found",
|
|
49
|
+
category=UserWarning,
|
|
50
|
+
)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from .bruco import Bruco, BrucoResult
|
|
4
|
+
from .coupling import CouplingFunctionAnalysis, estimate_coupling
|
|
5
|
+
from .coupling_result import CouplingResult, CouplingResultCollection
|
|
6
|
+
from .response import (
|
|
7
|
+
ResponseFunctionAnalysis,
|
|
8
|
+
ResponseFunctionResult,
|
|
9
|
+
detect_step_segments,
|
|
10
|
+
estimate_response_function,
|
|
11
|
+
)
|
|
12
|
+
from .stat_info import association_edges, build_graph
|
|
13
|
+
from .stats import SpectralStats
|
|
14
|
+
from .threshold import (
|
|
15
|
+
PercentileThreshold,
|
|
16
|
+
RatioThreshold,
|
|
17
|
+
SigmaThreshold,
|
|
18
|
+
ThresholdStrategy,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"Bruco",
|
|
23
|
+
"BrucoResult",
|
|
24
|
+
"estimate_coupling",
|
|
25
|
+
"CouplingFunctionAnalysis",
|
|
26
|
+
"CouplingResult",
|
|
27
|
+
"CouplingResultCollection",
|
|
28
|
+
"ResponseFunctionAnalysis",
|
|
29
|
+
"ResponseFunctionResult",
|
|
30
|
+
"SpectralStats",
|
|
31
|
+
"ThresholdStrategy",
|
|
32
|
+
"RatioThreshold",
|
|
33
|
+
"SigmaThreshold",
|
|
34
|
+
"PercentileThreshold",
|
|
35
|
+
"estimate_response_function",
|
|
36
|
+
"detect_step_segments",
|
|
37
|
+
"association_edges",
|
|
38
|
+
"build_graph",
|
|
39
|
+
]
|