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.
Files changed (364) hide show
  1. gwexpy/__init__.py +224 -0
  2. gwexpy/_bootstrap.py +59 -0
  3. gwexpy/_version.py +3 -0
  4. gwexpy/_warnings.py +50 -0
  5. gwexpy/analysis/__init__.py +39 -0
  6. gwexpy/analysis/bruco.py +1746 -0
  7. gwexpy/analysis/coupling.py +1034 -0
  8. gwexpy/analysis/coupling_result.py +1155 -0
  9. gwexpy/analysis/response.py +999 -0
  10. gwexpy/analysis/stat_info.py +103 -0
  11. gwexpy/analysis/stats.py +52 -0
  12. gwexpy/analysis/threshold.py +409 -0
  13. gwexpy/astro/__init__.py +14 -0
  14. gwexpy/astro/range.py +28 -0
  15. gwexpy/cli/__init__.py +58 -0
  16. gwexpy/cli/__main__.py +6 -0
  17. gwexpy/cli/cliproduct.py +42 -0
  18. gwexpy/cli/coherence.py +12 -0
  19. gwexpy/cli/coherencegram.py +10 -0
  20. gwexpy/cli/gwpy_plot.py +5 -0
  21. gwexpy/cli/qtransform.py +18 -0
  22. gwexpy/cli/spectrogram.py +15 -0
  23. gwexpy/cli/spectrum.py +15 -0
  24. gwexpy/cli/timeseries.py +13 -0
  25. gwexpy/cli/transferfunction.py +15 -0
  26. gwexpy/detector/__init__.py +14 -0
  27. gwexpy/detector/channel.py +23 -0
  28. gwexpy/detector/io/__init__.py +9 -0
  29. gwexpy/detector/io/cis.py +15 -0
  30. gwexpy/detector/io/clf.py +17 -0
  31. gwexpy/detector/io/omega.py +15 -0
  32. gwexpy/detector/units.py +21 -0
  33. gwexpy/fields/__init__.py +46 -0
  34. gwexpy/fields/base.py +540 -0
  35. gwexpy/fields/collections.py +307 -0
  36. gwexpy/fields/demo.py +315 -0
  37. gwexpy/fields/scalar.py +2303 -0
  38. gwexpy/fields/signal.py +1533 -0
  39. gwexpy/fields/tensor.py +464 -0
  40. gwexpy/fields/vector.py +387 -0
  41. gwexpy/fitting/__init__.py +83 -0
  42. gwexpy/fitting/core.py +1245 -0
  43. gwexpy/fitting/gls.py +183 -0
  44. gwexpy/fitting/highlevel.py +363 -0
  45. gwexpy/fitting/mixin.py +59 -0
  46. gwexpy/fitting/models.py +255 -0
  47. gwexpy/frequencyseries/__init__.py +32 -0
  48. gwexpy/frequencyseries/_fdcommon.py +1 -0
  49. gwexpy/frequencyseries/bifrequencymap.py +876 -0
  50. gwexpy/frequencyseries/collections.py +1099 -0
  51. gwexpy/frequencyseries/frequencyseries.py +1686 -0
  52. gwexpy/frequencyseries/hist.py +1 -0
  53. gwexpy/frequencyseries/io/__init__.py +9 -0
  54. gwexpy/frequencyseries/io/ascii.py +6 -0
  55. gwexpy/frequencyseries/io/dttxml.py +258 -0
  56. gwexpy/frequencyseries/io/hdf5.py +6 -0
  57. gwexpy/frequencyseries/io/ligolw.py +1 -0
  58. gwexpy/frequencyseries/io/stubs.py +38 -0
  59. gwexpy/frequencyseries/matrix.py +145 -0
  60. gwexpy/frequencyseries/matrix_analysis.py +197 -0
  61. gwexpy/frequencyseries/matrix_core.py +95 -0
  62. gwexpy/histogram/__init__.py +18 -0
  63. gwexpy/histogram/_core.py +415 -0
  64. gwexpy/histogram/_rebin.py +260 -0
  65. gwexpy/histogram/_typing.py +40 -0
  66. gwexpy/histogram/collections.py +436 -0
  67. gwexpy/histogram/histogram.py +395 -0
  68. gwexpy/histogram/io/__init__.py +1 -0
  69. gwexpy/histogram/io/_hdf5.py +104 -0
  70. gwexpy/interop/__init__.py +305 -0
  71. gwexpy/interop/_modal_helpers.py +215 -0
  72. gwexpy/interop/_optional.py +194 -0
  73. gwexpy/interop/_registry.py +142 -0
  74. gwexpy/interop/_time.py +98 -0
  75. gwexpy/interop/astropy_.py +39 -0
  76. gwexpy/interop/base.py +34 -0
  77. gwexpy/interop/control_.py +227 -0
  78. gwexpy/interop/cupy_.py +42 -0
  79. gwexpy/interop/dask_.py +39 -0
  80. gwexpy/interop/emg3d_.py +494 -0
  81. gwexpy/interop/errors.py +38 -0
  82. gwexpy/interop/exudyn_.py +123 -0
  83. gwexpy/interop/finesse_.py +280 -0
  84. gwexpy/interop/frequency.py +184 -0
  85. gwexpy/interop/gwinc_.py +200 -0
  86. gwexpy/interop/harmonica_.py +93 -0
  87. gwexpy/interop/hdf5_.py +69 -0
  88. gwexpy/interop/jax_.py +24 -0
  89. gwexpy/interop/json_.py +47 -0
  90. gwexpy/interop/lal_.py +221 -0
  91. gwexpy/interop/meep_.py +322 -0
  92. gwexpy/interop/meshio_.py +369 -0
  93. gwexpy/interop/metpy_.py +90 -0
  94. gwexpy/interop/mne_.py +490 -0
  95. gwexpy/interop/mt_.py +274 -0
  96. gwexpy/interop/multitaper_.py +277 -0
  97. gwexpy/interop/neo_.py +107 -0
  98. gwexpy/interop/netcdf4_.py +62 -0
  99. gwexpy/interop/obspy_.py +300 -0
  100. gwexpy/interop/openems_.py +405 -0
  101. gwexpy/interop/opensees_.py +133 -0
  102. gwexpy/interop/pandas_.py +228 -0
  103. gwexpy/interop/polars_.py +232 -0
  104. gwexpy/interop/pycbc_.py +184 -0
  105. gwexpy/interop/pydub_.py +69 -0
  106. gwexpy/interop/pyoma_.py +97 -0
  107. gwexpy/interop/pyroomacoustics_.py +578 -0
  108. gwexpy/interop/pyspeckit_.py +69 -0
  109. gwexpy/interop/pyspice_.py +331 -0
  110. gwexpy/interop/quantities_.py +110 -0
  111. gwexpy/interop/root_.py +544 -0
  112. gwexpy/interop/sdynpy_.py +231 -0
  113. gwexpy/interop/sdypy_.py +141 -0
  114. gwexpy/interop/simpeg_.py +202 -0
  115. gwexpy/interop/skrf_.py +524 -0
  116. gwexpy/interop/specutils_.py +88 -0
  117. gwexpy/interop/sqlite_.py +92 -0
  118. gwexpy/interop/tensorflow_.py +22 -0
  119. gwexpy/interop/torch_.py +100 -0
  120. gwexpy/interop/torch_dataset.py +167 -0
  121. gwexpy/interop/wrf_.py +133 -0
  122. gwexpy/interop/xarray_.py +364 -0
  123. gwexpy/interop/zarr_.py +75 -0
  124. gwexpy/io/__init__.py +20 -0
  125. gwexpy/io/_framecpp.py +12 -0
  126. gwexpy/io/cache.py +14 -0
  127. gwexpy/io/collection_dir.py +165 -0
  128. gwexpy/io/datafind.py +19 -0
  129. gwexpy/io/dttxml_common.py +597 -0
  130. gwexpy/io/ffldatafind.py +22 -0
  131. gwexpy/io/gwf.py +20 -0
  132. gwexpy/io/hdf5.py +10 -0
  133. gwexpy/io/hdf5_collection.py +121 -0
  134. gwexpy/io/kerberos.py +6 -0
  135. gwexpy/io/ligolw.py +35 -0
  136. gwexpy/io/nds2.py +14 -0
  137. gwexpy/io/pickle_compat.py +88 -0
  138. gwexpy/io/registry.py +22 -0
  139. gwexpy/io/utils.py +297 -0
  140. gwexpy/noise/__init__.py +55 -0
  141. gwexpy/noise/asd.py +58 -0
  142. gwexpy/noise/colored.py +171 -0
  143. gwexpy/noise/field.py +202 -0
  144. gwexpy/noise/gwinc_.py +183 -0
  145. gwexpy/noise/line_mask.py +66 -0
  146. gwexpy/noise/magnetic.py +141 -0
  147. gwexpy/noise/non_gaussian.py +238 -0
  148. gwexpy/noise/obspy_.py +261 -0
  149. gwexpy/noise/peaks.py +166 -0
  150. gwexpy/noise/wave.py +956 -0
  151. gwexpy/numerics/__init__.py +38 -0
  152. gwexpy/numerics/constants.py +97 -0
  153. gwexpy/numerics/scaling.py +169 -0
  154. gwexpy/plot/__init__.py +48 -0
  155. gwexpy/plot/_coord.py +261 -0
  156. gwexpy/plot/_init_helpers.py +499 -0
  157. gwexpy/plot/_label_utils.py +50 -0
  158. gwexpy/plot/axes.py +25 -0
  159. gwexpy/plot/bode.py +6 -0
  160. gwexpy/plot/colorbar.py +14 -0
  161. gwexpy/plot/colors.py +17 -0
  162. gwexpy/plot/defaults.py +382 -0
  163. gwexpy/plot/field.py +222 -0
  164. gwexpy/plot/gauch_dashboard.py +121 -0
  165. gwexpy/plot/geomap.py +217 -0
  166. gwexpy/plot/gps.py +31 -0
  167. gwexpy/plot/legend.py +8 -0
  168. gwexpy/plot/log.py +17 -0
  169. gwexpy/plot/pairplot.py +248 -0
  170. gwexpy/plot/plot.py +554 -0
  171. gwexpy/plot/rc.py +20 -0
  172. gwexpy/plot/segments.py +22 -0
  173. gwexpy/plot/skymap.py +188 -0
  174. gwexpy/plot/tex.py +1 -0
  175. gwexpy/plot/text.py +1 -0
  176. gwexpy/plot/units.py +9 -0
  177. gwexpy/plot/utils.py +71 -0
  178. gwexpy/py.typed +0 -0
  179. gwexpy/segments/__init__.py +14 -0
  180. gwexpy/segments/flag.py +6 -0
  181. gwexpy/segments/io/__init__.py +10 -0
  182. gwexpy/segments/io/hdf5.py +6 -0
  183. gwexpy/segments/io/json.py +12 -0
  184. gwexpy/segments/io/ligolw.py +20 -0
  185. gwexpy/segments/io/segwizard.py +17 -0
  186. gwexpy/segments/segments.py +4 -0
  187. gwexpy/signal/__init__.py +49 -0
  188. gwexpy/signal/fft.py +6 -0
  189. gwexpy/signal/filter_design.py +4 -0
  190. gwexpy/signal/normalization.py +153 -0
  191. gwexpy/signal/preprocessing/__init__.py +16 -0
  192. gwexpy/signal/preprocessing/imputation.py +282 -0
  193. gwexpy/signal/preprocessing/ml.py +388 -0
  194. gwexpy/signal/preprocessing/standardization.py +114 -0
  195. gwexpy/signal/preprocessing/whitening.py +174 -0
  196. gwexpy/signal/qtransform.py +10 -0
  197. gwexpy/signal/spectral/__init__.py +18 -0
  198. gwexpy/signal/spectral/_lal.py +27 -0
  199. gwexpy/signal/spectral/_median_mean.py +1 -0
  200. gwexpy/signal/spectral/_pycbc.py +1 -0
  201. gwexpy/signal/spectral/_registry.py +1 -0
  202. gwexpy/signal/spectral/_scipy.py +21 -0
  203. gwexpy/signal/spectral/_ui.py +23 -0
  204. gwexpy/signal/spectral/_utils.py +1 -0
  205. gwexpy/signal/window.py +4 -0
  206. gwexpy/spectral/__init__.py +13 -0
  207. gwexpy/spectral/estimation.py +762 -0
  208. gwexpy/spectrogram/__init__.py +33 -0
  209. gwexpy/spectrogram/cleaning.py +154 -0
  210. gwexpy/spectrogram/coherence.py +11 -0
  211. gwexpy/spectrogram/collections.py +948 -0
  212. gwexpy/spectrogram/io/__init__.py +8 -0
  213. gwexpy/spectrogram/io/hdf5.py +6 -0
  214. gwexpy/spectrogram/matrix.py +849 -0
  215. gwexpy/spectrogram/matrix_analysis.py +131 -0
  216. gwexpy/spectrogram/matrix_core.py +194 -0
  217. gwexpy/spectrogram/spectrogram.py +1029 -0
  218. gwexpy/statistics/__init__.py +15 -0
  219. gwexpy/statistics/dq_flag.py +82 -0
  220. gwexpy/statistics/gauch.py +149 -0
  221. gwexpy/statistics/rayleigh_test.py +95 -0
  222. gwexpy/statistics/roc.py +85 -0
  223. gwexpy/statistics/student_t_indicator.py +124 -0
  224. gwexpy/table/__init__.py +25 -0
  225. gwexpy/table/filter.py +39 -0
  226. gwexpy/table/filters.py +13 -0
  227. gwexpy/table/gravityspy.py +35 -0
  228. gwexpy/table/io/__init__.py +37 -0
  229. gwexpy/table/io/cwb.py +23 -0
  230. gwexpy/table/io/fetch.py +17 -0
  231. gwexpy/table/io/gravityspy.py +11 -0
  232. gwexpy/table/io/gstlal.py +47 -0
  233. gwexpy/table/io/gwf.py +27 -0
  234. gwexpy/table/io/hacr.py +39 -0
  235. gwexpy/table/io/ligolw.py +47 -0
  236. gwexpy/table/io/losc.py +33 -0
  237. gwexpy/table/io/omega.py +21 -0
  238. gwexpy/table/io/omicron.py +13 -0
  239. gwexpy/table/io/pycbc.py +47 -0
  240. gwexpy/table/io/root.py +27 -0
  241. gwexpy/table/io/snax.py +25 -0
  242. gwexpy/table/io/sql.py +17 -0
  243. gwexpy/table/io/utils.py +21 -0
  244. gwexpy/table/segment_cell.py +117 -0
  245. gwexpy/table/segment_plot.py +551 -0
  246. gwexpy/table/segment_table.py +1118 -0
  247. gwexpy/table/table.py +35 -0
  248. gwexpy/time/__init__.py +21 -0
  249. gwexpy/time/__main__.py +19 -0
  250. gwexpy/time/_tconvert.py +29 -0
  251. gwexpy/time/core.py +185 -0
  252. gwexpy/timeseries/__init__.py +57 -0
  253. gwexpy/timeseries/_analysis.py +411 -0
  254. gwexpy/timeseries/_core.py +100 -0
  255. gwexpy/timeseries/_gwf_io.py +243 -0
  256. gwexpy/timeseries/_interop.py +1191 -0
  257. gwexpy/timeseries/_resampling.py +822 -0
  258. gwexpy/timeseries/_signal.py +1573 -0
  259. gwexpy/timeseries/_spectral.py +23 -0
  260. gwexpy/timeseries/_spectral_fourier.py +580 -0
  261. gwexpy/timeseries/_spectral_special.py +1672 -0
  262. gwexpy/timeseries/_statistics.py +732 -0
  263. gwexpy/timeseries/_timeseries_legacy.py +41 -0
  264. gwexpy/timeseries/_typing.py +69 -0
  265. gwexpy/timeseries/arima.py +473 -0
  266. gwexpy/timeseries/collections.py +1981 -0
  267. gwexpy/timeseries/core.py +41 -0
  268. gwexpy/timeseries/decomposition.py +708 -0
  269. gwexpy/timeseries/hurst.py +362 -0
  270. gwexpy/timeseries/io/__init__.py +31 -0
  271. gwexpy/timeseries/io/_registration.py +290 -0
  272. gwexpy/timeseries/io/ascii.py +13 -0
  273. gwexpy/timeseries/io/ats.py +337 -0
  274. gwexpy/timeseries/io/audio.py +267 -0
  275. gwexpy/timeseries/io/cache.py +11 -0
  276. gwexpy/timeseries/io/core.py +13 -0
  277. gwexpy/timeseries/io/csv_config.py +133 -0
  278. gwexpy/timeseries/io/csv_enhanced.py +463 -0
  279. gwexpy/timeseries/io/dttxml.py +133 -0
  280. gwexpy/timeseries/io/gbd.py +441 -0
  281. gwexpy/timeseries/io/gwf/__init__.py +51 -0
  282. gwexpy/timeseries/io/gwf/framecpp.py +11 -0
  283. gwexpy/timeseries/io/gwf/framel.py +25 -0
  284. gwexpy/timeseries/io/gwf/lalframe.py +11 -0
  285. gwexpy/timeseries/io/hdf5.py +45 -0
  286. gwexpy/timeseries/io/losc.py +11 -0
  287. gwexpy/timeseries/io/nds2.py +29 -0
  288. gwexpy/timeseries/io/ndscope_hdf5.py +274 -0
  289. gwexpy/timeseries/io/netcdf4_.py +409 -0
  290. gwexpy/timeseries/io/sdb.py +175 -0
  291. gwexpy/timeseries/io/seismic.py +270 -0
  292. gwexpy/timeseries/io/stubs.py +32 -0
  293. gwexpy/timeseries/io/tdms.py +160 -0
  294. gwexpy/timeseries/io/wav.py +149 -0
  295. gwexpy/timeseries/io/win.py +244 -0
  296. gwexpy/timeseries/io/zarr_.py +256 -0
  297. gwexpy/timeseries/matrix.py +360 -0
  298. gwexpy/timeseries/matrix_analysis.py +919 -0
  299. gwexpy/timeseries/matrix_core.py +495 -0
  300. gwexpy/timeseries/matrix_interop.py +50 -0
  301. gwexpy/timeseries/matrix_spectral.py +415 -0
  302. gwexpy/timeseries/pipeline.py +617 -0
  303. gwexpy/timeseries/preprocess.py +1437 -0
  304. gwexpy/timeseries/rolling.py +362 -0
  305. gwexpy/timeseries/spectral.py +319 -0
  306. gwexpy/timeseries/statevector.py +8 -0
  307. gwexpy/timeseries/timeseries.py +431 -0
  308. gwexpy/timeseries/utils.py +371 -0
  309. gwexpy/types/__init__.py +75 -0
  310. gwexpy/types/_stats.py +269 -0
  311. gwexpy/types/array.py +82 -0
  312. gwexpy/types/array2d.py +137 -0
  313. gwexpy/types/array3d.py +315 -0
  314. gwexpy/types/array4d.py +444 -0
  315. gwexpy/types/axis.py +125 -0
  316. gwexpy/types/axis_api.py +261 -0
  317. gwexpy/types/hht_spectrogram.py +130 -0
  318. gwexpy/types/index.py +13 -0
  319. gwexpy/types/io/__init__.py +13 -0
  320. gwexpy/types/io/ascii.py +25 -0
  321. gwexpy/types/io/hdf5.py +45 -0
  322. gwexpy/types/io/ligolw.py +17 -0
  323. gwexpy/types/metadata.py +939 -0
  324. gwexpy/types/mixin/__init__.py +27 -0
  325. gwexpy/types/mixin/_collection_mixin.py +156 -0
  326. gwexpy/types/mixin/_plot_mixin.py +19 -0
  327. gwexpy/types/mixin/_protocols.py +228 -0
  328. gwexpy/types/mixin/mixin_legacy.py +90 -0
  329. gwexpy/types/mixin/signal_interop.py +326 -0
  330. gwexpy/types/plane2d.py +86 -0
  331. gwexpy/types/series.py +17 -0
  332. gwexpy/types/series_creator.py +156 -0
  333. gwexpy/types/series_matrix_analysis.py +389 -0
  334. gwexpy/types/series_matrix_core.py +328 -0
  335. gwexpy/types/series_matrix_indexing.py +275 -0
  336. gwexpy/types/series_matrix_io.py +387 -0
  337. gwexpy/types/series_matrix_math.py +566 -0
  338. gwexpy/types/series_matrix_structure.py +222 -0
  339. gwexpy/types/series_matrix_validation_mixin.py +186 -0
  340. gwexpy/types/series_matrix_visualization.py +14 -0
  341. gwexpy/types/seriesmatrix.py +29 -0
  342. gwexpy/types/seriesmatrix_base.py +608 -0
  343. gwexpy/types/seriesmatrix_validation.py +943 -0
  344. gwexpy/types/sliceutils.py +17 -0
  345. gwexpy/types/time_plane_transform.py +410 -0
  346. gwexpy/types/typing.py +190 -0
  347. gwexpy/utils/__init__.py +9 -0
  348. gwexpy/utils/decorators.py +17 -0
  349. gwexpy/utils/enum.py +11 -0
  350. gwexpy/utils/env.py +11 -0
  351. gwexpy/utils/fft_args.py +332 -0
  352. gwexpy/utils/lal.py +39 -0
  353. gwexpy/utils/logger.py +18 -0
  354. gwexpy/utils/misc.py +11 -0
  355. gwexpy/utils/mp.py +13 -0
  356. gwexpy/utils/progress.py +13 -0
  357. gwexpy/utils/shell.py +19 -0
  358. gwexpy/utils/units.py +191 -0
  359. gwexpy-0.1.1.dist-info/METADATA +203 -0
  360. gwexpy-0.1.1.dist-info/RECORD +364 -0
  361. gwexpy-0.1.1.dist-info/WHEEL +5 -0
  362. gwexpy-0.1.1.dist-info/entry_points.txt +2 -0
  363. gwexpy-0.1.1.dist-info/licenses/LICENSE.txt +21 -0
  364. 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
@@ -0,0 +1,3 @@
1
+ from __future__ import annotations
2
+
3
+ __version__ = "0.1.1"
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
+ ]