fastlisaresponse 1.1.4__cp310-cp310-macosx_14_0_arm64.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.

Potentially problematic release.


This version of fastlisaresponse might be problematic. Click here for more details.

@@ -0,0 +1,95 @@
1
+ """Definition of FASTLISA package common exceptions"""
2
+
3
+ try:
4
+ from exceptiongroup import ExceptionGroup
5
+ except (ImportError, ModuleNotFoundError):
6
+ ExceptionGroup = ExceptionGroup
7
+
8
+
9
+ class FASTLISAException(Exception):
10
+ """Base class for FASTLISA package exceptions."""
11
+
12
+ pass
13
+
14
+
15
+ class CudaException(FASTLISAException):
16
+ """Base class for CUDA-related exceptions."""
17
+
18
+ pass
19
+
20
+
21
+ class CuPyException(FASTLISAException):
22
+ """Base class for CuPy-related exceptions."""
23
+
24
+ pass
25
+
26
+
27
+ class MissingDependency(FASTLISAException):
28
+ """Exception raised when a required dependency is missing."""
29
+
30
+ pass
31
+
32
+
33
+ class InvalidInputFile(FASTLISAException):
34
+ """Exception raised when the content of an input file does not match expectations."""
35
+
36
+
37
+ class ConfigurationError(FASTLISAException):
38
+ """Exception raised when configuration setup fails."""
39
+
40
+
41
+ class ConfigurationMissing(ConfigurationError):
42
+ """Exception raised when an expected configuration entry is missing."""
43
+
44
+
45
+ class ConfigurationValidationError(ConfigurationError):
46
+ """Exception raised when a configuration entry is invalid."""
47
+
48
+
49
+ class FileManagerException(FASTLISAException):
50
+ """Exception raised by the FileManager."""
51
+
52
+
53
+ class FileNotInRegistry(FileManagerException):
54
+ """Exception raised when a requested file is not in file registry."""
55
+
56
+
57
+ class FileNotFoundLocally(FileManagerException):
58
+ """Exception raised when file not found locally but expected to be."""
59
+
60
+
61
+ class FileInvalidChecksum(FileManagerException):
62
+ """Exception raised when file has invalid checksum."""
63
+
64
+
65
+ class FileDownloadException(FileManagerException):
66
+ """Exception raised if file download failed."""
67
+
68
+
69
+ class FileDownloadNotFound(FileDownloadException):
70
+ """Exception raised if file is not found at expected URL."""
71
+
72
+
73
+ class FileDownloadConnectionError(FileDownloadException):
74
+ """Exception raised in case of connection error during download."""
75
+
76
+
77
+ class FileDownloadIntegrityError(FileDownloadException):
78
+ """Exception raised in case of integrity error after download."""
79
+
80
+
81
+ class FileManagerDisabledAccess(FileManagerException):
82
+ """Exception raised when trying to access a file whose tags are disabled"""
83
+
84
+ disabled_tag: str
85
+ file_name: str
86
+
87
+ def __init__(self, /, *args, disabled_tag: str, file_name: str, **kwargs):
88
+ self.disabled_tag = disabled_tag
89
+ self.file_name = file_name
90
+ super().__init__(*args, **kwargs)
91
+
92
+
93
+ ### Trajectory-related exceptions
94
+ class TrajectoryOffGridException(Exception):
95
+ """Exception raised when a trajectory goes off-grid (except for the lower boundary in p)."""
@@ -0,0 +1,11 @@
1
+ from typing import Optional, Sequence, TypeVar, Union
2
+ import types
3
+
4
+
5
+ from gpubackendtools import ParallelModuleBase
6
+
7
+
8
+ class FastLISAResponseParallelModule(ParallelModuleBase):
9
+ def __init__(self, force_backend=None):
10
+ force_backend_in = ('fastlisaresponse', force_backend) if isinstance(force_backend, str) else force_backend
11
+ super().__init__(force_backend_in)
@@ -0,0 +1,82 @@
1
+ import numpy as np
2
+
3
+ try:
4
+ import cupy as cp
5
+ from pyresponse import get_response_wrap as get_response_wrap_gpu
6
+ from pyresponse import get_tdi_delays_wrap as get_tdi_delays_wrap_gpu
7
+
8
+ gpu = True
9
+
10
+ except (ImportError, ModuleNotFoundError) as e:
11
+ import numpy as xp
12
+
13
+ gpu = False
14
+
15
+
16
+ def get_overlap(sig1, sig2, phase_maximize=False, use_gpu=False):
17
+ """Calculate the mismatch across TDI channels
18
+
19
+ Calculates the overlap between two sets of TDI observables in the time
20
+ domain. The overlap is complex allowing for the addition of overlap
21
+ over all channels. It can be phase maximized as well.
22
+
23
+ This function has GPU capabilities.
24
+
25
+ Args:
26
+ sig1 (list or xp.ndarray): TDI observables for first signal. Must be ``list`` of
27
+ ``xp.ndarray`` or a single ``xp.ndarray``. Must have same length as ``sig2`` in terms
28
+ of number of channels and length of the indivudal channels.
29
+ sig2 (list or xp.ndarray): TDI observables for second signal. Must be ``list`` of
30
+ ``xp.ndarray`` or a single ``xp.ndarray``. Must have same length as ``sig1`` in terms
31
+ of number of channels and length of the individual channels.
32
+ phase_maximize (bool, optional): If ``True``, maximize over the phase in the overlap.
33
+ This is equivalent to getting the magnitude of the phasor that is the complex
34
+ overlap. (Defaut: ``False``)
35
+ use_gpu (bool, optional): If ``True``, use the GPU. This sets ``xp=cupy``. If ``False,
36
+ use the CPU and set ``xp=numpy``.
37
+
38
+ Returns:
39
+ double: Overlap as a real value.
40
+
41
+ """
42
+
43
+ # choose right array library
44
+ if use_gpu:
45
+ xp = cp
46
+ else:
47
+ xp = np
48
+
49
+ # check inputs
50
+ if not isinstance(sig1, list):
51
+ if not isinstance(sig1, xp.ndarray):
52
+ raise ValueError("sig1 must be list of or single xp.ndarray.")
53
+
54
+ elif sig1.ndim < 2:
55
+ sig1 = [sig1]
56
+
57
+ if not isinstance(sig2, list):
58
+ if not isinstance(sig2, xp.ndarray):
59
+ raise ValueError("sig1 must be list of or single xp.ndarray.")
60
+
61
+ elif sig1.ndim < 2:
62
+ sig2 = [sig2]
63
+
64
+ assert len(sig1) == len(sig2)
65
+ assert len(sig1[0]) == len(sig2[0])
66
+
67
+ # complex overlap
68
+ overlap = 0.0 + 1j * 0.0
69
+ for sig1_i, sig2_i in zip(sig1, sig2):
70
+ overlap_i = np.dot(np.fft.rfft(sig1_i).conj(), np.fft.rfft(sig2_i)) / np.sqrt(
71
+ np.dot(np.fft.rfft(sig1_i).conj(), np.fft.rfft(sig1_i))
72
+ * np.dot(np.fft.rfft(sig2_i).conj(), np.fft.rfft(sig2_i))
73
+ )
74
+ overlap += overlap_i
75
+
76
+ overlap /= len(sig1)
77
+
78
+ if phase_maximize:
79
+ return np.abs(overlap)
80
+
81
+ else:
82
+ return overlap.real
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.2
2
+ Name: fastlisaresponse
3
+ Version: 1.1.4
4
+ Summary: GPU-accelerated LISA Response Function
5
+ Author-Email: Michael Katz <mikekatz04@gmail.com>
6
+ Classifier: Environment :: GPU :: NVIDIA CUDA
7
+ Classifier: License :: OSI Approved :: Apache Software License
8
+ Classifier: Natural Language :: English
9
+ Classifier: Programming Language :: C++
10
+ Classifier: Programming Language :: Cython
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Requires-Python: >=3.9
18
+ Requires-Dist: lisaanalysistools>=1.0.17
19
+ Requires-Dist: exceptiongroup; python_version < "3.11"
20
+ Requires-Dist: h5py
21
+ Requires-Dist: matplotlib
22
+ Requires-Dist: gpubackendtools
23
+ Requires-Dist: jsonschema
24
+ Requires-Dist: lisaconstants
25
+ Requires-Dist: multispline
26
+ Requires-Dist: numba
27
+ Requires-Dist: numpy
28
+ Requires-Dist: nvidia-ml-py
29
+ Requires-Dist: platformdirs
30
+ Requires-Dist: pydantic
31
+ Requires-Dist: pyyaml
32
+ Requires-Dist: requests
33
+ Requires-Dist: rich
34
+ Requires-Dist: scipy
35
+ Requires-Dist: tqdm
36
+ Requires-Dist: wrapt
37
+ Provides-Extra: doc
38
+ Requires-Dist: ipykernel; extra == "doc"
39
+ Requires-Dist: ipython; extra == "doc"
40
+ Requires-Dist: ipywidgets; extra == "doc"
41
+ Requires-Dist: myst-parser; extra == "doc"
42
+ Requires-Dist: nbsphinx; extra == "doc"
43
+ Requires-Dist: pypandoc; extra == "doc"
44
+ Requires-Dist: sphinx; extra == "doc"
45
+ Requires-Dist: sphinx-rtd-theme; extra == "doc"
46
+ Requires-Dist: sphinx-tippy; extra == "doc"
47
+ Requires-Dist: astropy; extra == "doc"
48
+ Provides-Extra: sampling
49
+ Requires-Dist: eryn; extra == "sampling"
50
+ Requires-Dist: fastlisaresponse; extra == "sampling"
51
+ Requires-Dist: lisaanalysistools; extra == "sampling"
52
+ Requires-Dist: astropy; extra == "sampling"
53
+ Provides-Extra: testing
54
+ Requires-Dist: matplotlib; extra == "testing"
55
+ Requires-Dist: astropy; extra == "testing"
56
+ Description-Content-Type: text/markdown
57
+
58
+ # fastlisaresponse: Generic LISA response function for GPUs
59
+
60
+ This code base provides a GPU-accelerated version of the generic time-domain LISA response function. The GPU-acceleration allows this code to be used directly in Parameter Estimation.
61
+
62
+ Please see the [documentation](https://mikekatz04.github.io/lisa-on-gpu/) for further information on these modules. The code can be found on Github [here](https://github.com/mikekatz04/lisa-on-gpu). It can be found on [Zenodo](https://zenodo.org/record/3981654#.XzS_KRNKjlw).
63
+
64
+ If you use all or any parts of this code, please cite [arXiv:2204.06633](https://arxiv.org/abs/2204.06633). See the [documentation](https://mikekatz04.github.io/lisa-on-gpu/) to properly cite specific modules.
65
+
66
+
67
+ ## Getting Started
68
+
69
+ Install with pip:
70
+ ```
71
+ pip install fastlisaresponse
72
+ ```
73
+ To import fastlisaresponse:
74
+
75
+ ```
76
+ from fastlisaresponse import ResponseWrapper
77
+ ```
78
+
79
+ See [examples notebook](https://github.com/mikekatz04/lisa-on-gpu/blob/master/examples/fast_LISA_response_tutorial.ipynb).
80
+
81
+
82
+ ### Prerequisites
83
+
84
+ Now (version 1.0.11) `fastlisaresponse` requires the newest version of [LISA Analysis Tools](github.com/mikekatz04/LISAanalysistools). You can run `pip install lisaanalysistools`.
85
+
86
+ To install this software for CPU usage, you need Python >3.4 and NumPy. To run the examples, you will also need jupyter and matplotlib. We generally recommend installing everything, including gcc and g++ compilers, in the conda environment as is shown in the examples here. This generally helps avoid compilation and linking issues. If you use your own chosen compiler, you will need to make sure all necessary information is passed to the setup command (see below). You also may need to add information to the `setup.py` file.
87
+
88
+ To install this software for use with NVIDIA GPUs (compute capability >2.0), you need the [CUDA toolkit](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) and [CuPy](https://cupy.chainer.org/). The CUDA toolkit must have cuda version >8.0. Be sure to properly install CuPy within the correct CUDA toolkit version. Make sure the nvcc binary is on `$PATH` or set it as the `CUDAHOME` environment variable.
89
+
90
+
91
+ ### Installing
92
+
93
+
94
+ Install with pip (CPU only for now):
95
+ ```
96
+ pip install fastlisaresponse
97
+ ```
98
+
99
+ To install from source:
100
+
101
+ 0) [Install Anaconda](https://docs.anaconda.com/anaconda/install/) if you do not have it.
102
+
103
+ 1) Create a virtual environment.
104
+
105
+ ```
106
+ conda create -n lisa_resp_env -c conda-forge gcc_linux-64 gxx_linux-64 numpy Cython scipy jupyter ipython h5py matplotlib python=3.12
107
+ conda activate lisa_resp_env
108
+ ```
109
+
110
+ If on MACOSX, substitute `gcc_linux-64` and `gxx_linus-64` with `clang_osx-64` and `clangxx_osx-64`.
111
+
112
+ If you want a faster install, you can install the python packages (numpy, Cython, scipy, tqdm, jupyter, ipython, h5py, requests, matplotlib) with pip.
113
+
114
+ 2) Clone the repository.
115
+
116
+ ```
117
+ git clone https://github.com/mikekatz04/lisa-on-gpu.git
118
+ cd lisa-on-gpu
119
+ ```
120
+
121
+ 3) If using GPUs, use pip to [install cupy](https://docs-cupy.chainer.org/en/stable/install.html).
122
+
123
+ ```
124
+ pip install cupy-12x
125
+ ```
126
+
127
+ 4) Run install. Make sure CUDA is on your PATH.
128
+
129
+ ```
130
+ python scripts/prebuild.py
131
+ pip install .
132
+ ```
133
+
134
+ ## Running the Tests
135
+
136
+ Run the example notebook or the tests using `unittest` from the main directory of the code:
137
+ ```
138
+ python -m unittest discover
139
+ ```
140
+
141
+ ## Contributing
142
+
143
+ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
144
+
145
+ ## Versioning
146
+
147
+ We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/mikekatz04/lisa-on-gpu/tags).
148
+
149
+ Current Version: 1.0.11
150
+
151
+ ## Authors
152
+
153
+ * **Michael Katz**
154
+ * Jean-Baptiste Bayle
155
+ * Alvin J. K. Chua
156
+ * Michele Vallisneri
157
+
158
+ ### Contibutors
159
+
160
+ * Maybe you!
161
+
162
+ ## License
163
+
164
+ This project is licensed under the GNU License - see the [LICENSE.md](LICENSE.md) file for details.
165
+
166
+ ## Acknowledgments
167
+
168
+ * It was also supported in part through the computational resources and staff contributions provided for the Quest/Grail high performance computing facility at Northwestern University.
@@ -0,0 +1,19 @@
1
+ fastlisaresponse-1.1.4.dist-info/RECORD,,
2
+ fastlisaresponse-1.1.4.dist-info/WHEEL,sha256=cCT7ZH_6vDT6SkgkxfqQSiKXi5jBdOpKUtShUXXOJgY,114
3
+ fastlisaresponse-1.1.4.dist-info/METADATA,sha256=4HqbOL8GiNhCI-vl2HGBtf90TlMPRRWF9gDJ8sk3x_8,6170
4
+ fastlisaresponse_backend_cpu/git_version.py,sha256=DjRT4kE7SCmyes5A7uT_iWqnKpLYeH2Xt9JITz2G8ws,140
5
+ fastlisaresponse_backend_cpu/responselisa.cpython-310-darwin.so,sha256=kBYSPr8nTsKdjIZs-F9UVxnYaIHfGy7uWW7pCXtNJU8,148048
6
+ fastlisaresponse/_version.py,sha256=u-IJdVvNgkPmB4EypXx7iHPUTbdrT6j_v7FWXSVMszE,704
7
+ fastlisaresponse/__init__.py,sha256=ACNhskEnHRlU9easprR0-BPrHa6xVgAWD3AzPgt0Dw4,1599
8
+ fastlisaresponse/git_version.py.in,sha256=Yt2d-2rBlJCK1XzVzjO81molm1_Nb_6NrYsxGuoCxmc,147
9
+ fastlisaresponse/response.py,sha256=K_ljuFrUqWYKj0qHWHPOxW7KvPnVef098NkPHoOjrwQ,29031
10
+ fastlisaresponse/git_version.py,sha256=DjRT4kE7SCmyes5A7uT_iWqnKpLYeH2Xt9JITz2G8ws,140
11
+ fastlisaresponse/cutils/__init__.py,sha256=8t9ZozjqwwNXRwxsdO_EkEJzccgSeSGthisAdX0wf38,4817
12
+ fastlisaresponse/utils/citations.py,sha256=zf79Zb37isbgBmTa9YNZOaYnoOz7tRwHz_MShID_f8E,11150
13
+ fastlisaresponse/utils/parallelbase.py,sha256=Hqkmggnz9Kkae910fz0_KvGLJ8EPIAQ6J_azdgDjlog,379
14
+ fastlisaresponse/utils/config.py,sha256=dMdcOXTVNS9__DwynXInM2DGbBpwbB93IZI-EkQtisE,28450
15
+ fastlisaresponse/utils/utility.py,sha256=NrJdBmEnLkLPk6Ile1TZg8jNLw6xERiSp58iGVlz01s,2709
16
+ fastlisaresponse/utils/__init__.py,sha256=pf2NmWKs_uQNzlyA5iNO1gTRDISKNmIIsvOcKqQ3hgw,33
17
+ fastlisaresponse/utils/exceptions.py,sha256=ypqEROHLYcEdhQeI6k6TLzdtkr7ox0Hv7jx6tG9PK5U,2599
18
+ fastlisaresponse/.dylibs/libstdc++.6.dylib,sha256=YRgQOmm9lS4MQ5teetYivYBgxMBNUxqoxJFFeGWJ6Ww,3403344
19
+ fastlisaresponse/.dylibs/libgcc_s.1.1.dylib,sha256=shDpHcc3TKA9JnAkGu8opKGy_omB4ODP2VSvsUs40k0,221280
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: scikit-build-core 0.11.6
3
+ Root-Is-Purelib: false
4
+ Tag: cp310-cp310-macosx_14_0_arm64
5
+
@@ -0,0 +1,7 @@
1
+ """Metadata deduced from git at build time."""
2
+
3
+ id: str
4
+ short_id: str
5
+
6
+ id = "fc57dfe9046150a7cfc185abdf4c675e76fd316e"
7
+ short_id = "fc57dfe"