astro-otter 0.2.0__tar.gz → 1.0.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 (35) hide show
  1. {astro_otter-0.2.0/src/astro_otter.egg-info → astro_otter-1.0.1}/PKG-INFO +10 -11
  2. {astro_otter-0.2.0 → astro_otter-1.0.1}/README.md +2 -7
  3. {astro_otter-0.2.0 → astro_otter-1.0.1}/pyproject.toml +76 -3
  4. {astro_otter-0.2.0 → astro_otter-1.0.1/src/astro_otter.egg-info}/PKG-INFO +10 -11
  5. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/astro_otter.egg-info/SOURCES.txt +2 -0
  6. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/astro_otter.egg-info/requires.txt +6 -2
  7. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/__init__.py +13 -0
  8. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/_version.py +1 -1
  9. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/io/data_finder.py +10 -2
  10. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/io/otter.py +447 -92
  11. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/io/transient.py +690 -137
  12. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/plotter/otter_plotter.py +6 -1
  13. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/plotter/plotter.py +1 -9
  14. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/schema.py +39 -21
  15. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/util.py +41 -1
  16. {astro_otter-0.2.0 → astro_otter-1.0.1}/tests/test_data_finder.py +15 -11
  17. {astro_otter-0.2.0 → astro_otter-1.0.1}/tests/test_host.py +8 -1
  18. astro_otter-1.0.1/tests/test_otter.py +261 -0
  19. astro_otter-1.0.1/tests/test_plotter.py +176 -0
  20. astro_otter-1.0.1/tests/test_schema.py +189 -0
  21. astro_otter-1.0.1/tests/test_transient.py +5894 -0
  22. astro_otter-1.0.1/tests/test_util.py +94 -0
  23. astro_otter-0.2.0/tests/test_otter.py +0 -229
  24. astro_otter-0.2.0/tests/test_transient.py +0 -1304
  25. astro_otter-0.2.0/tests/test_util.py +0 -44
  26. {astro_otter-0.2.0 → astro_otter-1.0.1}/LICENSE +0 -0
  27. {astro_otter-0.2.0 → astro_otter-1.0.1}/setup.cfg +0 -0
  28. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/astro_otter.egg-info/dependency_links.txt +0 -0
  29. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/astro_otter.egg-info/top_level.txt +0 -0
  30. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/exceptions.py +0 -0
  31. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/io/__init__.py +0 -0
  32. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/io/host.py +0 -0
  33. {astro_otter-0.2.0 → astro_otter-1.0.1}/src/otter/plotter/__init__.py +0 -0
  34. {astro_otter-0.2.0 → astro_otter-1.0.1}/tests/test_exceptions.py +0 -0
  35. {astro_otter-0.2.0 → astro_otter-1.0.1}/tests/test_package.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astro-otter
3
- Version: 0.2.0
3
+ Version: 1.0.1
4
4
  Author-email: Noah Franz <nfranz@arizona.edu>
5
5
  License: MIT License
6
6
 
@@ -36,7 +36,7 @@ Classifier: Programming Language :: Python :: 3
36
36
  Classifier: Programming Language :: Python :: 3.10
37
37
  Classifier: Programming Language :: Python :: 3.11
38
38
  Classifier: Development Status :: 2 - Pre-Alpha
39
- Requires-Python: <3.12,>=3.10
39
+ Requires-Python: >=3.9
40
40
  Description-Content-Type: text/markdown
41
41
  License-File: LICENSE
42
42
  Requires-Dist: numpy<2,>=1.20
@@ -45,6 +45,7 @@ Requires-Dist: pandas
45
45
  Requires-Dist: synphot
46
46
  Requires-Dist: typing-extensions
47
47
  Requires-Dist: pyarango
48
+ Requires-Dist: tabulate
48
49
  Requires-Dist: matplotlib
49
50
  Requires-Dist: plotly
50
51
  Requires-Dist: astroquery
@@ -53,8 +54,9 @@ Requires-Dist: skypatrol
53
54
  Requires-Dist: fundamentals
54
55
  Requires-Dist: astro-datalab
55
56
  Requires-Dist: sparclclient
56
- Requires-Dist: astro-ghost
57
- Requires-Dist: pydantic
57
+ Requires-Dist: pydantic>=2
58
+ Requires-Dist: dustmaps
59
+ Requires-Dist: dust_extinction
58
60
  Requires-Dist: pyreadline3; platform_system == "Windows"
59
61
  Provides-Extra: docs
60
62
  Requires-Dist: Sphinx>=3.0.0; extra == "docs"
@@ -68,6 +70,8 @@ Requires-Dist: autodoc_pydantic; extra == "docs"
68
70
  Provides-Extra: dev
69
71
  Requires-Dist: ruff; extra == "dev"
70
72
  Requires-Dist: pre-commit; extra == "dev"
73
+ Requires-Dist: pytest-timeout; extra == "dev"
74
+ Requires-Dist: python-semantic-release; extra == "dev"
71
75
  Dynamic: license-file
72
76
 
73
77
  # OTTER API
@@ -117,6 +121,7 @@ python3 -m pip install astro-otter
117
121
  ```
118
122
  git clone https://github.com/astro-otter/otter.git $OTTER_ROOT/otter
119
123
  git clone https://github.com/astro-otter/otterdb.git $OTTER_ROOT/otterdb
124
+ git clone https://github.com/astro-otter/otter-web.git $OTTER_ROOT/otter-web
120
125
  ```
121
126
  3. Install the NASA ADS Python API by following the instructions at https://ads.readthedocs.io/en/latest/#getting-started
122
127
  4. Install otter, the API for this database. From
@@ -125,13 +130,7 @@ python3 -m pip install astro-otter
125
130
  cd $OTTER_ROOT/otter
126
131
  python -m pip install -e .
127
132
  ```
128
- 5. Process the data to build the local "database" (although it is really just a directory).
129
- Then, you can build the "database" by running the
130
- following commands:
131
- ```
132
- cd $OTTER_ROOT/otter/scripts/
133
- python3 gen_summary_table.py --otterroot $OTTER_ROOT
134
- ```
133
+ 5. Process the data to build the local copy of the database. Follow the instructions in the otterdb repo README.
135
134
  6. Easily access the data using the Otter code! In python:
136
135
  ```
137
136
  import os
@@ -45,6 +45,7 @@ python3 -m pip install astro-otter
45
45
  ```
46
46
  git clone https://github.com/astro-otter/otter.git $OTTER_ROOT/otter
47
47
  git clone https://github.com/astro-otter/otterdb.git $OTTER_ROOT/otterdb
48
+ git clone https://github.com/astro-otter/otter-web.git $OTTER_ROOT/otter-web
48
49
  ```
49
50
  3. Install the NASA ADS Python API by following the instructions at https://ads.readthedocs.io/en/latest/#getting-started
50
51
  4. Install otter, the API for this database. From
@@ -53,13 +54,7 @@ python3 -m pip install astro-otter
53
54
  cd $OTTER_ROOT/otter
54
55
  python -m pip install -e .
55
56
  ```
56
- 5. Process the data to build the local "database" (although it is really just a directory).
57
- Then, you can build the "database" by running the
58
- following commands:
59
- ```
60
- cd $OTTER_ROOT/otter/scripts/
61
- python3 gen_summary_table.py --otterroot $OTTER_ROOT
62
- ```
57
+ 5. Process the data to build the local copy of the database. Follow the instructions in the otterdb repo README.
63
58
  6. Easily access the data using the Otter code! In python:
64
59
  ```
65
60
  import os
@@ -9,7 +9,7 @@ readme = "README.md"
9
9
  license = {file = "LICENSE"}
10
10
  dynamic = ["version"]
11
11
 
12
- requires-python = ">=3.10,<3.12"
12
+ requires-python = ">=3.9" #,<3.12"
13
13
 
14
14
  classifiers = [
15
15
  "License :: OSI Approved :: BSD License",
@@ -33,6 +33,7 @@ dependencies = [
33
33
  "synphot",
34
34
  "typing-extensions",
35
35
  "pyarango",
36
+ "tabulate",
36
37
 
37
38
  # for the plotting
38
39
  "matplotlib",
@@ -45,10 +46,13 @@ dependencies = [
45
46
  "fundamentals",
46
47
  "astro-datalab",
47
48
  "sparclclient",
48
- "astro-ghost",
49
49
 
50
50
  # for the schema validation
51
- "pydantic",
51
+ "pydantic>=2",
52
+
53
+ # for MW dust extinction corrections
54
+ "dustmaps",
55
+ "dust_extinction",
52
56
 
53
57
  # only for windows OS b/c it doesn't ship with readline by default
54
58
  'pyreadline3; platform_system == "Windows"'
@@ -74,6 +78,8 @@ docs = [
74
78
  dev = [
75
79
  "ruff", # linter
76
80
  "pre-commit", # enable pre-commit hooks
81
+ "pytest-timeout", # ignores tests that take to long
82
+ "python-semantic-release", # for automated semantic versioning
77
83
  ]
78
84
 
79
85
  [tool.setuptools.packages.find]
@@ -117,3 +123,70 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
117
123
  [tool.ruff.format]
118
124
  indent-style = "space"
119
125
  quote-style = "double"
126
+
127
+ [tool.semantic_release]
128
+ assets = []
129
+ build_command_env = []
130
+ commit_message = "v{version}\n\nAutomatically generated by python-semantic-release [skip actions]"
131
+ commit_parser = "conventional"
132
+ logging_use_named_masks = false
133
+ major_on_zero = true
134
+ allow_zero_version = true
135
+ no_git_verify = false
136
+ tag_format = "v{version}"
137
+ add_partial_tags = false
138
+ version_variables = ["src/otter/_version.py:__version__"]
139
+
140
+ [tool.semantic_release.branches.main]
141
+ match = "main"
142
+ prerelease_token = "rc"
143
+ prerelease = false
144
+
145
+ [tool.semantic_release.changelog]
146
+ changelog_file = ""
147
+ exclude_commit_patterns = []
148
+ mode = "update"
149
+ insertion_flag = "<!-- version list -->"
150
+ template_dir = "templates"
151
+
152
+ [tool.semantic_release.changelog.default_templates]
153
+ changelog_file = "CHANGELOG.md"
154
+ output_format = "md"
155
+ mask_initial_release = true
156
+
157
+ [tool.semantic_release.changelog.environment]
158
+ block_start_string = "{%"
159
+ block_end_string = "%}"
160
+ variable_start_string = "{{"
161
+ variable_end_string = "}}"
162
+ comment_start_string = "{#"
163
+ comment_end_string = "#}"
164
+ trim_blocks = false
165
+ lstrip_blocks = false
166
+ newline_sequence = "\n"
167
+ keep_trailing_newline = false
168
+ extensions = []
169
+ autoescape = false
170
+
171
+ [tool.semantic_release.commit_author]
172
+ env = "GIT_COMMIT_AUTHOR"
173
+ default = "semantic-release <semantic-release>"
174
+
175
+ [tool.semantic_release.commit_parser_options]
176
+ minor_tags = ["feat"]
177
+ patch_tags = ["fix", "perf"]
178
+ other_allowed_tags = ["build", "chore", "ci", "docs", "style", "refactor", "test"]
179
+ allowed_tags = ["feat", "fix", "perf", "build", "chore", "ci", "docs", "style", "refactor", "test"]
180
+ default_bump_level = 0
181
+ parse_squash_commits = true
182
+ ignore_merge_commits = true
183
+
184
+ [tool.semantic_release.remote]
185
+ name = "origin"
186
+ type = "github"
187
+ ignore_token_for_push = false
188
+ insecure = false
189
+
190
+ [tool.semantic_release.publish]
191
+ dist_glob_patterns = ["dist/*"]
192
+ upload_to_vcs_release = true
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: astro-otter
3
- Version: 0.2.0
3
+ Version: 1.0.1
4
4
  Author-email: Noah Franz <nfranz@arizona.edu>
5
5
  License: MIT License
6
6
 
@@ -36,7 +36,7 @@ Classifier: Programming Language :: Python :: 3
36
36
  Classifier: Programming Language :: Python :: 3.10
37
37
  Classifier: Programming Language :: Python :: 3.11
38
38
  Classifier: Development Status :: 2 - Pre-Alpha
39
- Requires-Python: <3.12,>=3.10
39
+ Requires-Python: >=3.9
40
40
  Description-Content-Type: text/markdown
41
41
  License-File: LICENSE
42
42
  Requires-Dist: numpy<2,>=1.20
@@ -45,6 +45,7 @@ Requires-Dist: pandas
45
45
  Requires-Dist: synphot
46
46
  Requires-Dist: typing-extensions
47
47
  Requires-Dist: pyarango
48
+ Requires-Dist: tabulate
48
49
  Requires-Dist: matplotlib
49
50
  Requires-Dist: plotly
50
51
  Requires-Dist: astroquery
@@ -53,8 +54,9 @@ Requires-Dist: skypatrol
53
54
  Requires-Dist: fundamentals
54
55
  Requires-Dist: astro-datalab
55
56
  Requires-Dist: sparclclient
56
- Requires-Dist: astro-ghost
57
- Requires-Dist: pydantic
57
+ Requires-Dist: pydantic>=2
58
+ Requires-Dist: dustmaps
59
+ Requires-Dist: dust_extinction
58
60
  Requires-Dist: pyreadline3; platform_system == "Windows"
59
61
  Provides-Extra: docs
60
62
  Requires-Dist: Sphinx>=3.0.0; extra == "docs"
@@ -68,6 +70,8 @@ Requires-Dist: autodoc_pydantic; extra == "docs"
68
70
  Provides-Extra: dev
69
71
  Requires-Dist: ruff; extra == "dev"
70
72
  Requires-Dist: pre-commit; extra == "dev"
73
+ Requires-Dist: pytest-timeout; extra == "dev"
74
+ Requires-Dist: python-semantic-release; extra == "dev"
71
75
  Dynamic: license-file
72
76
 
73
77
  # OTTER API
@@ -117,6 +121,7 @@ python3 -m pip install astro-otter
117
121
  ```
118
122
  git clone https://github.com/astro-otter/otter.git $OTTER_ROOT/otter
119
123
  git clone https://github.com/astro-otter/otterdb.git $OTTER_ROOT/otterdb
124
+ git clone https://github.com/astro-otter/otter-web.git $OTTER_ROOT/otter-web
120
125
  ```
121
126
  3. Install the NASA ADS Python API by following the instructions at https://ads.readthedocs.io/en/latest/#getting-started
122
127
  4. Install otter, the API for this database. From
@@ -125,13 +130,7 @@ python3 -m pip install astro-otter
125
130
  cd $OTTER_ROOT/otter
126
131
  python -m pip install -e .
127
132
  ```
128
- 5. Process the data to build the local "database" (although it is really just a directory).
129
- Then, you can build the "database" by running the
130
- following commands:
131
- ```
132
- cd $OTTER_ROOT/otter/scripts/
133
- python3 gen_summary_table.py --otterroot $OTTER_ROOT
134
- ```
133
+ 5. Process the data to build the local copy of the database. Follow the instructions in the otterdb repo README.
135
134
  6. Easily access the data using the Otter code! In python:
136
135
  ```
137
136
  import os
@@ -24,5 +24,7 @@ tests/test_exceptions.py
24
24
  tests/test_host.py
25
25
  tests/test_otter.py
26
26
  tests/test_package.py
27
+ tests/test_plotter.py
28
+ tests/test_schema.py
27
29
  tests/test_transient.py
28
30
  tests/test_util.py
@@ -4,6 +4,7 @@ pandas
4
4
  synphot
5
5
  typing-extensions
6
6
  pyarango
7
+ tabulate
7
8
  matplotlib
8
9
  plotly
9
10
  astroquery
@@ -12,8 +13,9 @@ skypatrol
12
13
  fundamentals
13
14
  astro-datalab
14
15
  sparclclient
15
- astro-ghost
16
- pydantic
16
+ pydantic>=2
17
+ dustmaps
18
+ dust_extinction
17
19
 
18
20
  [:platform_system == "Windows"]
19
21
  pyreadline3
@@ -21,6 +23,8 @@ pyreadline3
21
23
  [dev]
22
24
  ruff
23
25
  pre-commit
26
+ pytest-timeout
27
+ python-semantic-release
24
28
 
25
29
  [docs]
26
30
  Sphinx>=3.0.0
@@ -7,6 +7,19 @@ from ._version import __version__
7
7
  # explicitly set the package variable to ensure relative import work
8
8
  __package__ = "otter"
9
9
 
10
+ # lazy load the SFD dust map, if needed
11
+ import os
12
+ import dustmaps
13
+ dustmaps_datapath = os.path.join(
14
+ os.path.dirname(dustmaps.__file__),
15
+ "data",
16
+ "sfd",
17
+ "SFD_dust_4096_sgp.fits"
18
+ )
19
+ if not os.path.exists(dustmaps_datapath):
20
+ import dustmaps.sfd
21
+ dustmaps.sfd.fetch()
22
+
10
23
  # import important stuff
11
24
  from .io.otter import Otter
12
25
  from .io.transient import Transient
@@ -2,4 +2,4 @@
2
2
  Just define the package version in one place
3
3
  """
4
4
 
5
- __version__ = "0.2.0"
5
+ __version__ = "1.0.1"
@@ -602,8 +602,16 @@ class DataFinder(object):
602
602
  cone_search_res = qc.query(adql=adql, fmt="pandas")
603
603
 
604
604
  # then retrieve all of the spectra corresponding to those sparcl_ids
605
- sparcl_ids = cone_search_res.sparcl_id.tolist()
606
- res = client.retrieve(uuid_list=sparcl_ids, include=include)
605
+ spec_ids = cone_search_res.targetid.tolist()
606
+ if len(spec_ids) == 0:
607
+ logger.warn("Object not found in Sparcl!")
608
+ return
609
+
610
+ res = client.retrieve_by_specid(spec_ids, include=include)
611
+ if res.count == 0:
612
+ logger.warn("No Spectra available in sparcl!")
613
+ return
614
+
607
615
  all_spec = pd.concat([pd.DataFrame([record]) for record in res.records])
608
616
  return Table.from_pandas(all_spec)
609
617