sdss-almanac 0.2.9__tar.gz → 0.2.11__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 (34) hide show
  1. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/PKG-INFO +1 -1
  2. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/pyproject.toml +1 -1
  3. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/__init__.py +1 -1
  4. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/cli.py +2 -2
  5. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/exposure.py +12 -2
  6. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/plate.py +8 -2
  7. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/PKG-INFO +1 -1
  8. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/LICENSE.md +0 -0
  9. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/README.md +0 -0
  10. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/setup.cfg +0 -0
  11. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/apogee.py +0 -0
  12. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/catalog.py +0 -0
  13. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/config.py +0 -0
  14. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/__init__.py +0 -0
  15. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/fps.py +0 -0
  16. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/metadata.py +0 -0
  17. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/types.py +0 -0
  18. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/data_models/utils.py +0 -0
  19. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/database.py +0 -0
  20. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/display.py +0 -0
  21. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/etc/__init__.py +0 -0
  22. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/etc/bad_exposures.csv +0 -0
  23. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/io.py +0 -0
  24. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/logger.py +0 -0
  25. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/qa.py +0 -0
  26. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/stash/data_models.py +0 -0
  27. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/stash/plugmap_models.py +0 -0
  28. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/almanac/utils.py +0 -0
  29. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/SOURCES.txt +0 -0
  30. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/dependency_links.txt +0 -0
  31. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/entry_points.txt +0 -0
  32. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/not-zip-safe +0 -0
  33. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/requires.txt +0 -0
  34. {sdss_almanac-0.2.9 → sdss_almanac-0.2.11}/src/sdss_almanac.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdss-almanac
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: Everything we've got
5
5
  Author-email: Andy Casey <andrew.casey@monash.edu>
6
6
  License: BSD 3-Clause License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sdss-almanac"
7
- version = "0.2.9"
7
+ version = "0.2.11"
8
8
  authors = [
9
9
  { name = "Andy Casey", email = "andrew.casey@monash.edu" }
10
10
  ]
@@ -1,4 +1,4 @@
1
- __version__ = "0.2.9"
1
+ __version__ = "0.2.11"
2
2
 
3
3
  from .config import config, get_config_path, ConfigManager
4
4
  from .logger import logger
@@ -383,10 +383,10 @@ def update(key, value, **kwargs):
383
383
  click.echo(click.style("Deprecated: use `almanac config set`", fg="yellow"))
384
384
  return set(key, value, **kwargs)
385
385
 
386
- @config.command
386
+ @config.command(name="set")
387
387
  @click.argument("key")
388
388
  @click.argument("value")
389
- def set(key, value, **kwargs):
389
+ def _set(key, value, **kwargs):
390
390
  """Set a configuration value"""
391
391
 
392
392
  from almanac import config, get_config_path, ConfigManager
@@ -77,6 +77,13 @@ class Exposure(BaseModel):
77
77
  #def sparse_pak(self) -> bool:
78
78
  # return "sparse" in self.observer_comment.lower()
79
79
 
80
+ def __str__(self):
81
+ return (
82
+ f"<Exposure(observatory={self.observatory},"
83
+ f" mjd={self.mjd}, exposure={self.exposure},"
84
+ f" image_type={self.image_type})>"
85
+ )
86
+
80
87
  @computed_field
81
88
  def flagged_bad(self) -> bool:
82
89
  marked_bad = (self.observatory, self.mjd, self.exposure) in lookup_bad_exposures
@@ -342,8 +349,11 @@ class Exposure(BaseModel):
342
349
  # went wrong in early plate era.
343
350
  rows["plugged_mjd"] = self.plugged_mjd
344
351
  rows["observatory"] = self.observatory
345
-
346
- self._targets = tuple([factory(**r) for r in rows])
352
+ try:
353
+ self._targets = tuple([factory(**r) for r in rows])
354
+ except Exception as e:
355
+ e.add_note(f"Originated from {self}")
356
+ raise
347
357
  else:
348
358
  self._targets = tuple()
349
359
  return self._targets
@@ -49,7 +49,7 @@ class PlateTarget(BaseModel):
49
49
 
50
50
  # Instrument identifiers
51
51
  spectrograph_id: int = Field(alias="spectrographId", description="Spectrograph ID", default=-1)
52
- fiber_id: int = Field(alias="fiberId", description="Fiber ID", default=-1)
52
+ fiber_id: int = Field(alias="fiberId", description="Fiber ID", ge=1, le=300)
53
53
  planned_fiber_id: int = Field(alias="fiberid", description="Fiber ID", default=-1)
54
54
  throughput: int = Field(description="Throughput value", default=-1)
55
55
 
@@ -137,6 +137,12 @@ class PlateTarget(BaseModel):
137
137
  break
138
138
 
139
139
  if self.fiber_id in (53, 60):
140
- self.fiber_id = -1 # unpopulated fiber
140
+ # The DRP indicates that these are unpopulated fibers.
141
+ self.hole_type = "unplugged"
142
+ self.category = "unplugged"
143
+ self.planned_hole_type = "unplugged"
144
+ self.ra = np.nan
145
+ self.dec = np.nan
146
+ self.obj_type = "na"
141
147
 
142
148
  return self
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sdss-almanac
3
- Version: 0.2.9
3
+ Version: 0.2.11
4
4
  Summary: Everything we've got
5
5
  Author-email: Andy Casey <andrew.casey@monash.edu>
6
6
  License: BSD 3-Clause License
File without changes
File without changes
File without changes