jaxtfwaves 0.2.0__tar.gz → 0.3.1__tar.gz

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 (38) hide show
  1. jaxtfwaves-0.3.1/.pre-commit-config.yaml +18 -0
  2. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/PKG-INFO +80 -56
  3. jaxtfwaves-0.3.1/README.md +147 -0
  4. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/sobhb-example-ripple.ipynb +734 -456
  5. jaxtfwaves-0.3.1/notebooks/tlt-api-tour.ipynb +172 -0
  6. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/pyproject.toml +7 -3
  7. jaxtfwaves-0.3.1/src/tfwaves/__init__.py +27 -0
  8. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfwaves/response.py +0 -2
  9. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfwaves/stft.py +155 -167
  10. jaxtfwaves-0.3.1/src/tfwaves/tlt_adapters.py +244 -0
  11. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/tests/test_stft.py +10 -11
  12. jaxtfwaves-0.3.1/tests/test_tlt_adapters.py +235 -0
  13. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/uv.lock +53 -289
  14. jaxtfwaves-0.2.0/.pre-commit-config.yaml +0 -7
  15. jaxtfwaves-0.2.0/README.md +0 -124
  16. jaxtfwaves-0.2.0/src/tfwaves/__init__.py +0 -9
  17. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/.gitattributes +0 -0
  18. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/.gitignore +0 -0
  19. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/.gitlab-ci.yml +0 -0
  20. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/EMRI.ipynb +0 -0
  21. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/emri-example-2.ipynb +0 -0
  22. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/emri-example-tdi.ipynb +0 -0
  23. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/emri-example.ipynb +0 -0
  24. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/fd-linear-chirp_example.ipynb +0 -0
  25. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/linear-chirp-example-multiple-modes.ipynb +0 -0
  26. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/linear-chirp-example-tdi.ipynb +0 -0
  27. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/linear-chirp-example.ipynb +0 -0
  28. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/notebooks/sobhb-example.ipynb +0 -0
  29. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfplugins/__init__.py +0 -0
  30. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfplugins/sobhbwaveform/__init__.py +0 -0
  31. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfplugins/sobhbwaveform/sobhbparams.py +0 -0
  32. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfplugins/sobhbwaveform/sobhbwaveform_ripple.py +0 -0
  33. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfwaves/interpolation.py +0 -0
  34. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfwaves/utils.py +0 -0
  35. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/src/tfwaves/waveform.py +0 -0
  36. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/tests/__init__.py +0 -0
  37. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/tests/orbits.h5 +0 -0
  38. {jaxtfwaves-0.2.0 → jaxtfwaves-0.3.1}/tests/test_waveform.py +0 -0
@@ -0,0 +1,18 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.6.8
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ exclude: ^notebooks/.*\.ipynb$
8
+ - id: ruff-format
9
+ exclude: ^notebooks/.*\.ipynb$
10
+
11
+ - repo: local
12
+ hooks:
13
+ - id: pytest
14
+ name: pytest (uv)
15
+ entry: uv run pytest
16
+ language: system
17
+ pass_filenames: false
18
+ stages: [pre-push]
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jaxtfwaves
3
- Version: 0.2.0
3
+ Version: 0.3.1
4
4
  Summary: Fast time-frequency gravitational-wave response package for LISA data analysis with a JAX backend
5
- Author-email: Quentin Baghi <quentin.baghi@protonmail.com>, Gael Servignat <servignat@apc.in2p3.fr>, Saptarshi Ghosh <saptarshi.ghosh@apc.in2p3.fr>
6
- Requires-Python: <3.14,>=3.11
5
+ Author-email: Gael Servignat <servignat@apc.in2p3.fr>, Quentin Baghi <quentin.baghi@protonmail.com>, Saptarshi Ghosh <saptarshi.ghosh@apc.in2p3.fr>
6
+ Requires-Python: <3.14,>=3.12
7
7
  Requires-Dist: flax==0.12.0
8
8
  Requires-Dist: h5py<4.0.0,>=3.14.0
9
9
  Requires-Dist: jax==0.9.2
@@ -12,6 +12,7 @@ Requires-Dist: lisaconstants<3.0.0,>=2.0.1
12
12
  Requires-Dist: matplotlib
13
13
  Requires-Dist: numpy
14
14
  Requires-Dist: scipy
15
+ Requires-Dist: typed-lisa-toolkit
15
16
  Provides-Extra: plugins
16
17
  Requires-Dist: ripplegw<0.0.10,>=0.0.9; extra == 'plugins'
17
18
  Provides-Extra: sobhbwaveform
@@ -45,6 +46,80 @@ Or install all available plugins at once:
45
46
  pip install "jaxtfwaves[plugins]"
46
47
  ```
47
48
 
49
+ ## Typed API (TLT-First)
50
+
51
+ jaxtfwaves provides a typed output layer powered by typed-lisa-toolkit (TLT).
52
+ This is the direction of the public API: the interface is being normalized around
53
+ TLT-native objects rather than long-term raw sparse arrays.
54
+
55
+ Raw sparse outputs remain available for compatibility during the transition,
56
+ but new code should prefer the typed methods and adapters below.
57
+
58
+ ### High-level typed methods
59
+
60
+ Use these methods directly on waveform objects:
61
+
62
+ - `compute_hphc_tlt(...)`
63
+ - `compute_tdi_tlt(...)`
64
+
65
+ ```python
66
+ from tfwaves.stft import TimeToTFWaveform
67
+
68
+ # Build your waveform object as usual
69
+ wvf = TimeToTFWaveform(...)
70
+
71
+ stft_plus, stft_cross = wvf.compute_hphc_tlt(di=5)
72
+ tdi_data = wvf.compute_tdi_tlt(di=5) # defaults to XYZ or AET from wvf.channel
73
+ ```
74
+
75
+ ### Adapter-level typed helpers
76
+
77
+ If you already work with raw sparse outputs, convert them explicitly with:
78
+
79
+ - `normalize_sparse_stft_output`
80
+ - `sparse_stft_from_tracks`
81
+ - `hphc_stfts_from_tracks`
82
+ - `stftdata_from_tdi`
83
+
84
+ ```python
85
+ from tfwaves import hphc_stfts_from_tracks, stftdata_from_tdi
86
+
87
+ h_plus, h_cross, indices_f, indices_t = wvf.compute_hphc(di=5)
88
+ stft_plus, stft_cross = hphc_stfts_from_tracks(
89
+ h_plus,
90
+ h_cross,
91
+ indices_f,
92
+ indices_t,
93
+ wvf.f_bins,
94
+ wvf.t_bins,
95
+ )
96
+
97
+ tdi_values, indices_f, indices_t = wvf.compute_tdi_tf_response(di=5)
98
+ tdi_tlt = stftdata_from_tdi(
99
+ tdi_values,
100
+ indices_f,
101
+ indices_t,
102
+ wvf.f_bins,
103
+ wvf.t_bins,
104
+ )
105
+ ```
106
+
107
+ ### Channel naming behavior
108
+
109
+ - If waveform channel contains `XYZ`, `compute_tdi_tlt()` defaults to `X`, `Y`, `Z`.
110
+ - If waveform channel contains `AET`, `compute_tdi_tlt()` defaults to `A`, `E`, `T`.
111
+ - You can override names with `channel_names=(...)`.
112
+
113
+ ```python
114
+ tdi_custom = wvf.compute_tdi_tlt(channel_names=("C1", "C2", "C3"))
115
+ ```
116
+
117
+ ### Transition policy
118
+
119
+ The typed API is the canonical interface for new development. Transitional
120
+ raw-output pathways are retained for one release cycle and will be progressively
121
+ de-emphasized as TLT-normalized workflows become the default.
122
+
48
123
  ## Contributing
49
124
 
50
125
  ### Development environment
@@ -53,7 +128,7 @@ We use [uv](https://docs.astral.sh/uv/) for dependency management.
53
128
  First clone the repository on your machine and go in the directory:
54
129
 
55
130
  ```bash
56
- git clone git@gitlab.in2p3.fr:lisa-apc/tfwaves.git
131
+ git clone git@gitlab.in2p3.fr:servignat/jaxtfwaves.git
57
132
  cd jaxtfwaves
58
133
  ```
59
134
 
@@ -83,17 +158,6 @@ uv run ruff check src tests
83
158
  uv run ruff format --check src tests
84
159
  ```
85
160
 
86
- Alternatively, you can activate the virtual environment by running
87
-
88
- ```bash
89
- source .venv/bin/activate
90
- ```
91
- and deactivate it by just running
92
-
93
- ```bash
94
- deactivate
95
- ```
96
-
97
161
  ### Alternative local installation
98
162
 
99
163
  As an alternative to uv-managed environments, you can install the package in development mode when you are in the `jaxtfwaves` directory:
@@ -101,44 +165,4 @@ As an alternative to uv-managed environments, you can install the package in dev
101
165
  ```bash
102
166
  pip install -e . # core only
103
167
  pip install -e ".[plugins]" # core + plugins
104
- ```
105
-
106
- ## Publishing to PyPI
107
-
108
- 1. **Build** the package (from the repo root):
109
-
110
- ```bash
111
- uv build
112
- ```
113
-
114
- 2. **Check** the artifacts:
115
-
116
- ```bash
117
- uv run twine check dist/*
118
- ```
119
-
120
- 3. **Upload to TestPyPI** first:
121
-
122
- ```bash
123
- uv publish --publish-url https://test.pypi.org/legacy/ --token pypi-YOUR_TEST_TOKEN
124
- ```
125
-
126
- Verify the install:
127
-
128
- ```bash
129
- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple jaxtfwaves
130
- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple "jaxtfwaves[plugins]"
131
- ```
132
-
133
- 4. **Upload to PyPI**:
134
-
135
- ```bash
136
- uv publish --token pypi-YOUR_TOKEN
137
- ```
138
-
139
- 5. **Tag the release**:
140
-
141
- ```bash
142
- git tag v0.1.0
143
- git push origin v0.1.0
144
- ```
168
+ ```
@@ -0,0 +1,147 @@
1
+ # jaxtfwaves
2
+ JAXTFwaves is the sibling project of [tfwaves](https://gitlab.in2p3.fr/lisa-apc/tfwaves) that is using JAX as backend.
3
+
4
+ # tfwaves
5
+ TFWaves is a python package to compute fast time-frequency gravitational-wave response for LISA data analysis. It takes as imput phase and amplitude functions of the gravitational strain in the pseudo-inertial solar system barycenter frame, and outputs time-delay interferometry responses in the time-frequency domain.
6
+
7
+ ## Installation
8
+
9
+ The core package is available on PyPI:
10
+
11
+ ```bash
12
+ pip install jaxtfwaves
13
+ ```
14
+
15
+ To install a specific plugin, use its named extra:
16
+
17
+ ```bash
18
+ pip install "jaxtfwaves[sobhbwaveform]" # SOBHB waveforms via ripplegw
19
+ # pip install "jaxtfwaves[emriwaveform]" # EMRI waveforms (coming soon)
20
+ ```
21
+
22
+ Or install all available plugins at once:
23
+
24
+ ```bash
25
+ pip install "jaxtfwaves[plugins]"
26
+ ```
27
+
28
+ ## Typed API (TLT-First)
29
+
30
+ jaxtfwaves provides a typed output layer powered by typed-lisa-toolkit (TLT).
31
+ This is the direction of the public API: the interface is being normalized around
32
+ TLT-native objects rather than long-term raw sparse arrays.
33
+
34
+ Raw sparse outputs remain available for compatibility during the transition,
35
+ but new code should prefer the typed methods and adapters below.
36
+
37
+ ### High-level typed methods
38
+
39
+ Use these methods directly on waveform objects:
40
+
41
+ - `compute_hphc_tlt(...)`
42
+ - `compute_tdi_tlt(...)`
43
+
44
+ ```python
45
+ from tfwaves.stft import TimeToTFWaveform
46
+
47
+ # Build your waveform object as usual
48
+ wvf = TimeToTFWaveform(...)
49
+
50
+ stft_plus, stft_cross = wvf.compute_hphc_tlt(di=5)
51
+ tdi_data = wvf.compute_tdi_tlt(di=5) # defaults to XYZ or AET from wvf.channel
52
+ ```
53
+
54
+ ### Adapter-level typed helpers
55
+
56
+ If you already work with raw sparse outputs, convert them explicitly with:
57
+
58
+ - `normalize_sparse_stft_output`
59
+ - `sparse_stft_from_tracks`
60
+ - `hphc_stfts_from_tracks`
61
+ - `stftdata_from_tdi`
62
+
63
+ ```python
64
+ from tfwaves import hphc_stfts_from_tracks, stftdata_from_tdi
65
+
66
+ h_plus, h_cross, indices_f, indices_t = wvf.compute_hphc(di=5)
67
+ stft_plus, stft_cross = hphc_stfts_from_tracks(
68
+ h_plus,
69
+ h_cross,
70
+ indices_f,
71
+ indices_t,
72
+ wvf.f_bins,
73
+ wvf.t_bins,
74
+ )
75
+
76
+ tdi_values, indices_f, indices_t = wvf.compute_tdi_tf_response(di=5)
77
+ tdi_tlt = stftdata_from_tdi(
78
+ tdi_values,
79
+ indices_f,
80
+ indices_t,
81
+ wvf.f_bins,
82
+ wvf.t_bins,
83
+ )
84
+ ```
85
+
86
+ ### Channel naming behavior
87
+
88
+ - If waveform channel contains `XYZ`, `compute_tdi_tlt()` defaults to `X`, `Y`, `Z`.
89
+ - If waveform channel contains `AET`, `compute_tdi_tlt()` defaults to `A`, `E`, `T`.
90
+ - You can override names with `channel_names=(...)`.
91
+
92
+ ```python
93
+ tdi_custom = wvf.compute_tdi_tlt(channel_names=("C1", "C2", "C3"))
94
+ ```
95
+
96
+ ### Transition policy
97
+
98
+ The typed API is the canonical interface for new development. Transitional
99
+ raw-output pathways are retained for one release cycle and will be progressively
100
+ de-emphasized as TLT-normalized workflows become the default.
101
+
102
+ ## Contributing
103
+
104
+ ### Development environment
105
+
106
+ We use [uv](https://docs.astral.sh/uv/) for dependency management.
107
+ First clone the repository on your machine and go in the directory:
108
+
109
+ ```bash
110
+ git clone git@gitlab.in2p3.fr:servignat/jaxtfwaves.git
111
+ cd jaxtfwaves
112
+ ```
113
+
114
+ Create the lockfile and synchronize dependencies (including development tools):
115
+
116
+ ```bash
117
+ uv sync --all-extras --group dev
118
+ ```
119
+
120
+ We recommend you install pre-commit hooks to detect errors before you even
121
+ commit.
122
+
123
+ ```bash
124
+ uv run pre-commit install
125
+ ```
126
+
127
+ Then you can run any script using
128
+
129
+ ```bash
130
+ uv run python your_script.py
131
+ ```
132
+
133
+ Lint and format checks are handled with Ruff:
134
+
135
+ ```bash
136
+ uv run ruff check src tests
137
+ uv run ruff format --check src tests
138
+ ```
139
+
140
+ ### Alternative local installation
141
+
142
+ As an alternative to uv-managed environments, you can install the package in development mode when you are in the `jaxtfwaves` directory:
143
+
144
+ ```bash
145
+ pip install -e . # core only
146
+ pip install -e ".[plugins]" # core + plugins
147
+ ```