astro-otter 0.6.0__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.
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: astro-otter
3
+ Version: 0.6.0
4
+ Author-email: Noah Franz <nfranz@arizona.edu>
5
+ License: MIT License
6
+
7
+ Copyright (c) 2023 Noah Franz
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy
10
+ of this software and associated documentation files (the "Software"), to deal
11
+ in the Software without restriction, including without limitation the rights
12
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
+ copies of the Software, and to permit persons to whom the Software is
14
+ furnished to do so, subject to the following conditions:
15
+
16
+ The above copyright notice and this permission notice shall be included in all
17
+ copies or substantial portions of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25
+ SOFTWARE.
26
+
27
+ Project-URL: Home, https://github.com/astro-otter
28
+ Classifier: License :: OSI Approved :: BSD License
29
+ Classifier: Topic :: Scientific/Engineering
30
+ Classifier: Intended Audience :: Science/Research
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: Operating System :: OS Independent
33
+ Classifier: License :: OSI Approved :: BSD License
34
+ Classifier: Programming Language :: Python
35
+ Classifier: Programming Language :: Python :: 3
36
+ Classifier: Programming Language :: Python :: 3.10
37
+ Classifier: Programming Language :: Python :: 3.11
38
+ Classifier: Development Status :: 2 - Pre-Alpha
39
+ Requires-Python: >=3.9
40
+ Description-Content-Type: text/markdown
41
+ License-File: LICENSE
42
+ Requires-Dist: numpy<2,>=1.20
43
+ Requires-Dist: astropy>=6
44
+ Requires-Dist: pandas
45
+ Requires-Dist: synphot
46
+ Requires-Dist: typing-extensions
47
+ Requires-Dist: pyarango
48
+ Requires-Dist: tabulate
49
+ Requires-Dist: matplotlib
50
+ Requires-Dist: plotly
51
+ Requires-Dist: astroquery
52
+ Requires-Dist: ads
53
+ Requires-Dist: skypatrol
54
+ Requires-Dist: fundamentals
55
+ Requires-Dist: astro-datalab
56
+ Requires-Dist: sparclclient
57
+ Requires-Dist: pydantic>=2
58
+ Requires-Dist: pyreadline3; platform_system == "Windows"
59
+ Provides-Extra: docs
60
+ Requires-Dist: Sphinx>=3.0.0; extra == "docs"
61
+ Requires-Dist: myst-parser>=0.13; extra == "docs"
62
+ Requires-Dist: nbsphinx>=0.9.1; extra == "docs"
63
+ Requires-Dist: sphinx-book-theme>=0.0.33; extra == "docs"
64
+ Requires-Dist: sphinx_copybutton; extra == "docs"
65
+ Requires-Dist: autodoc; extra == "docs"
66
+ Requires-Dist: ipykernel; extra == "docs"
67
+ Requires-Dist: autodoc_pydantic; extra == "docs"
68
+ Provides-Extra: dev
69
+ Requires-Dist: ruff; extra == "dev"
70
+ Requires-Dist: pre-commit; extra == "dev"
71
+ Requires-Dist: pytest-timeout; extra == "dev"
72
+ Requires-Dist: python-semantic-release; extra == "dev"
73
+ Dynamic: license-file
74
+
75
+ # OTTER API
76
+ ### **O**pen mul**T**iwavelength **T**ransient **E**vent **R**epository
77
+
78
+ A Python API for the OTTER.
79
+
80
+ [actions-badge]: https://github.com/astro-otter/otter/workflows/CI/badge.svg
81
+ [actions-link]: https://github.com/astro-otter/otter/actions
82
+ [black-badge]: https://img.shields.io/badge/code%20style-black-000000.svg
83
+ [black-link]: https://github.com/psf/black
84
+ [conda-badge]: https://img.shields.io/conda/vn/conda-forge/hepfile
85
+ [conda-link]: https://github.com/conda-forge/hepfile-feedstock
86
+ [github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
87
+ [github-discussions-link]: https://github.com/mattbellis/hepfile/discussions
88
+ [gitter-badge]: https://badges.gitter.im/https://github.com/mattbellis/hepfile/community.svg
89
+ [gitter-link]: https://gitter.im/https://github.com/mattbellis/hepfile/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
90
+ [pypi-link]: https://pypi.org/project/astro-otter/
91
+ [pypi-platforms]: https://img.shields.io/pypi/pyversions/astro-otter
92
+ [pypi-version]: https://badge.fury.io/py/astro-otter.svg
93
+ [rtd-badge]: https://readthedocs.org/projects/otter/badge/?version=latest
94
+ [rtd-link]: https://otter.readthedocs.io/en/latest/?badge=latest
95
+ [sk-badge]: https://scikit-hep.org/assets/images/Scikit--HEP-Project-blue.svg
96
+ [ruff-badge]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
97
+ [ruff-link]: https://github.com/astral-sh/ruff
98
+ [codecov-badge]: https://codecov.io/gh/astro-otter/otter/graph/badge.svg?token=BtCerOdTc0
99
+ [codecov-link]: https://codecov.io/gh/astro-otter/otter
100
+
101
+ [![Documentation Status](https://readthedocs.org/projects/astro-otter/badge/?version=latest)](https://astro-otter.readthedocs.io/en/latest/?badge=latest)
102
+ [![Actions Status][actions-badge]][actions-link]
103
+ [![PyPI version][pypi-version]][pypi-link]
104
+ [![Linting: Ruff][ruff-badge]][ruff-link]
105
+ [![codecov][codecov-badge]][codecov-link]
106
+
107
+ ## Installation
108
+ To install the OTTER API use
109
+ ```
110
+ python3 -m pip install astro-otter
111
+ ```
112
+
113
+ ## Developer Instructions
114
+ 1. Set the `OTTER_ROOT` environment variable
115
+ ```
116
+ export OTTER_ROOT=/path/to/where/to/clone
117
+ ```
118
+ 2. Clone the relevant repos:
119
+ ```
120
+ git clone https://github.com/astro-otter/otter.git $OTTER_ROOT/otter
121
+ git clone https://github.com/astro-otter/otterdb.git $OTTER_ROOT/otterdb
122
+ git clone https://github.com/astro-otter/otter-web.git $OTTER_ROOT/otter-web
123
+ ```
124
+ 3. Install the NASA ADS Python API by following the instructions at https://ads.readthedocs.io/en/latest/#getting-started
125
+ 4. Install otter, the API for this database. From
126
+ the root directory where you installed these repos:
127
+ ```
128
+ cd $OTTER_ROOT/otter
129
+ python -m pip install -e .
130
+ ```
131
+ 5. Process the data to build the local copy of the database. Follow the instructions in the otterdb repo README.
132
+ 6. Easily access the data using the Otter code! In python:
133
+ ```
134
+ import os
135
+ from otter import Otter
136
+ otter = Otter(os.path.join(os.environ['OTTER_ROOT'], 'otterdb', '.otter'))
137
+ res = otter.query(names='AT2018hyz')
138
+ print(res)
139
+ ```
140
+
141
+ ## Installation from Source
142
+ To install the OTTER API from the source code use
143
+ ```
144
+ git clone https://github.com/astro-otter/otter.git
145
+ cd otter
146
+ python -m pip install .
147
+ ```
148
+ This will be changed into the more convenient `python -m pip install astro-otter` at a later date!
149
+
150
+ For developers, please also enable the pre-commit hooks using
151
+ ```
152
+ pre-commit install
153
+ ```
154
+
155
+ ## Repo Organization
156
+ | Directory | Contents |
157
+ |------------|------------|
158
+ | `src/otter` | A pip installable API for interfacing with the OTTER database|
159
+ | `scripts` | The pipeline scripts for converting unprocessed data into the OTTER JSON format|
160
+ | `docs` | Documentation for the OTTER API |
161
+ | `test` | Some Unit tests for the source code |
@@ -0,0 +1,18 @@
1
+ astro_otter-0.6.0.dist-info/licenses/LICENSE,sha256=s9IPE8A3CAMEaZpDhj4eaorpmfLYGB0mIGphq301PUY,1067
2
+ otter/__init__.py,sha256=pvX-TN7nLVmvKpkDi89Zxe-jMfHNiVMD3zsd_bPEK9Y,535
3
+ otter/_version.py,sha256=heI6Lp8C2IYF5xj3fj0P4LjDEWKu9zntpyyhLmbSGcQ,76
4
+ otter/exceptions.py,sha256=3lQF4AXVTfs9VRsVePQoIrXnramsPZbUL5crvf1s9Ng,1702
5
+ otter/schema.py,sha256=J-iI_kEEd0aHN_Hr49HFEa8W07enh1FSDbU99NwIz3Y,11240
6
+ otter/util.py,sha256=G5M2PdtPGKpRXCqkItyXMLj6h5F3EboBBDKWMViw04k,23333
7
+ otter/io/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ otter/io/data_finder.py,sha256=M6kzqMyy-yhwQfxbOs2E7i_8bCcZFW4Zyf8z-6LCxNQ,38425
9
+ otter/io/host.py,sha256=xv_SznZuvMoMVsZLqlcmlOyaqKCMZqlTQ_gkN4VBSTw,7139
10
+ otter/io/otter.py,sha256=UDjnolrOjSqAIN-4w1--C2jfW_TQZ4pzgr_1B5dKXOc,64618
11
+ otter/io/transient.py,sha256=UK7rWzeChN-YQHKtdbkqbc0ZNw1gP9tkx8mgSh4lsU8,56699
12
+ otter/plotter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
+ otter/plotter/otter_plotter.py,sha256=HSCCLUCubSr_VffF7-_KvqB6jYWeDvSYIxCv7LPoU70,2305
14
+ otter/plotter/plotter.py,sha256=ni4WV63wIjhMHStDmuccltaMHSaFbwwfztYpuMdYAz8,9340
15
+ astro_otter-0.6.0.dist-info/METADATA,sha256=xWIvo_d876rG_uCQUxCxf1LGzg15ctcWdOTLefChpCE,7150
16
+ astro_otter-0.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ astro_otter-0.6.0.dist-info/top_level.txt,sha256=Wth72sCwBRUk3KZGknSKvLQDMFuJk6qiaAavMDOdG5k,6
18
+ astro_otter-0.6.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Noah Franz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ otter
otter/__init__.py ADDED
@@ -0,0 +1,19 @@
1
+ from __future__ import annotations
2
+
3
+ # get the version
4
+ from ._version import __version__
5
+
6
+
7
+ # explicitly set the package variable to ensure relative import work
8
+ __package__ = "otter"
9
+
10
+ # import important stuff
11
+ from .io.otter import Otter
12
+ from .io.transient import Transient
13
+ from .io.host import Host
14
+ from .io.data_finder import DataFinder
15
+ from .plotter.otter_plotter import OtterPlotter
16
+ from .plotter.plotter import plot_light_curve, plot_sed, quick_view, query_quick_view
17
+ from . import util
18
+ from . import schema
19
+ from . import exceptions
otter/_version.py ADDED
@@ -0,0 +1,5 @@
1
+ """
2
+ Just define the package version in one place
3
+ """
4
+
5
+ __version__ = "0.6.0"
otter/exceptions.py ADDED
@@ -0,0 +1,74 @@
1
+ """
2
+ Custom exceptions for otter
3
+ """
4
+
5
+ from __future__ import annotations
6
+
7
+
8
+ class FailedQueryError(ValueError):
9
+ """
10
+ Exception thrown when the users query does not return any results.
11
+ """
12
+
13
+ def __str__(self):
14
+ txt = "You're query/search did not return any results! "
15
+ txt += "Try again with different parameters!"
16
+ return txt
17
+
18
+
19
+ class IOError(ValueError):
20
+ """
21
+ Exception thrown when the input or output argument/value is not the correct type.
22
+ """
23
+
24
+ pass
25
+
26
+
27
+ class OtterLimitationError(Exception):
28
+ """
29
+ Exception thrown when the user requests something that is currently not supported
30
+ by the API.
31
+ """
32
+
33
+ def __init__(self, msg):
34
+ self.msg = "Current Limitation Found: " + msg
35
+
36
+ def __str__(self):
37
+ return self.msg
38
+
39
+
40
+ class TransientMergeError(Exception):
41
+ """
42
+ Exception thrown when the Transient objects can not be combined as expected.
43
+ """
44
+
45
+ pass
46
+
47
+
48
+ class OtterNotImplementedError(Exception):
49
+ """
50
+ Exception thrown by methods that are not yet implemented
51
+ """
52
+
53
+ def __str__(self):
54
+ return "Not yet implemented! Please consider contributing on our GitHub!"
55
+
56
+
57
+ class MissingEnvVarError(Exception):
58
+ """
59
+ Thrown when the querying code expects an Environment variable and doesn't get one
60
+ """
61
+
62
+ def __init__(self, v, url=None):
63
+ self.v = v
64
+ self.url = url
65
+
66
+ def __str__(self):
67
+ msg = "You are missing the following environment variables:\n"
68
+ for vv in self.v:
69
+ msg += f"\t- {vv}\n"
70
+ msg += "Please make an account and/or set these variables!\n"
71
+ if self.url is not None:
72
+ msg += f"See: {self.url}"
73
+
74
+ return msg
otter/io/__init__.py ADDED
File without changes