wintertoo 1.6.1__tar.gz → 1.6.2__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.

Potentially problematic release.


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

Files changed (37) hide show
  1. {wintertoo-1.6.1 → wintertoo-1.6.2}/PKG-INFO +1 -1
  2. {wintertoo-1.6.1 → wintertoo-1.6.2}/pyproject.toml +1 -1
  3. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/models/too.py +33 -2
  4. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo.egg-info/PKG-INFO +1 -1
  5. {wintertoo-1.6.1 → wintertoo-1.6.2}/.github/dependabot.yml +0 -0
  6. {wintertoo-1.6.1 → wintertoo-1.6.2}/.github/workflows/automerge.yml +0 -0
  7. {wintertoo-1.6.1 → wintertoo-1.6.2}/.github/workflows/black.yml +0 -0
  8. {wintertoo-1.6.1 → wintertoo-1.6.2}/.github/workflows/continuous_integration.yml +0 -0
  9. {wintertoo-1.6.1 → wintertoo-1.6.2}/.github/workflows/isort.yml +0 -0
  10. {wintertoo-1.6.1 → wintertoo-1.6.2}/.github/workflows/pylint.yml +0 -0
  11. {wintertoo-1.6.1 → wintertoo-1.6.2}/.gitignore +0 -0
  12. {wintertoo-1.6.1 → wintertoo-1.6.2}/.pre-commit-config.yaml +0 -0
  13. {wintertoo-1.6.1 → wintertoo-1.6.2}/LICENSE +0 -0
  14. {wintertoo-1.6.1 → wintertoo-1.6.2}/README.md +0 -0
  15. {wintertoo-1.6.1 → wintertoo-1.6.2}/setup.cfg +0 -0
  16. {wintertoo-1.6.1 → wintertoo-1.6.2}/tests/test_fields.py +0 -0
  17. {wintertoo-1.6.1 → wintertoo-1.6.2}/tests/test_schedule.py +0 -0
  18. {wintertoo-1.6.1 → wintertoo-1.6.2}/tests/testdata/test_schedule.json +0 -0
  19. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/__init__.py +0 -0
  20. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/data/__init__.py +0 -0
  21. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/data/observing_request_schema.json +0 -0
  22. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/data/summer_fields.txt +0 -0
  23. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/data/winter_fields.txt +0 -0
  24. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/database.py +0 -0
  25. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/errors.py +0 -0
  26. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/fields.py +0 -0
  27. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/models/__init__.py +0 -0
  28. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/models/image.py +0 -0
  29. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/models/program.py +0 -0
  30. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/schedule.py +0 -0
  31. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/submit.py +0 -0
  32. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/utils.py +0 -0
  33. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo/validate.py +0 -0
  34. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo.egg-info/SOURCES.txt +0 -0
  35. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo.egg-info/dependency_links.txt +0 -0
  36. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo.egg-info/requires.txt +0 -0
  37. {wintertoo-1.6.1 → wintertoo-1.6.2}/wintertoo.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wintertoo
3
- Version: 1.6.1
3
+ Version: 1.6.2
4
4
  Author-email: Robert Stein <rdstein@caltech.edu>, Danielle Frostig <frostig@mit.edu>, Viraj Karambelkar <viraj@astro.caltech.edu>
5
5
  License: MIT
6
6
  Project-URL: homepage, https://github.com/winter-telescope/wintertoo
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "wintertoo"
7
- version = "1.6.1"
7
+ version = "1.6.2"
8
8
  description = ""
9
9
  authors = [
10
10
  {name = "Robert Stein", email = "rdstein@caltech.edu"},
@@ -64,11 +64,14 @@ class ToORequest(BaseModel):
64
64
  get_default_value("ditherStepSize"), ge=0.0, title="dither distance (arcsec)"
65
65
  )
66
66
  start_time_mjd: Optional[float] = Field(
67
- default=Time.now().mjd + 0.01,
67
+ default=None,
68
68
  title="ToO validity start (MJD)",
69
+ example=Time.now().mjd,
69
70
  )
70
71
  end_time_mjd: Optional[float] = Field(
71
- default=Time.now().mjd + 1, ge=Time.now().mjd, title="ToO validity end (MJD)"
72
+ default=None,
73
+ example=Time.now().mjd + 1,
74
+ title="ToO validity end (MJD)",
72
75
  )
73
76
  max_airmass: Optional[float] = Field(
74
77
  default=get_default_value("maxAirmass"),
@@ -92,6 +95,34 @@ class ToORequest(BaseModel):
92
95
  """
93
96
  return self.total_exposure_time / self.n_dither
94
97
 
98
+ @model_validator(mode="after")
99
+ def validate_date_order(self):
100
+ """
101
+ Ensure that the start date is before the end date
102
+
103
+ :return: validated field value
104
+ """
105
+ if self.start_time_mjd is None:
106
+ self.start_time_mjd = Time.now().mjd
107
+
108
+ if self.end_time_mjd is None:
109
+ self.end_time_mjd = Time.now().mjd + 7
110
+
111
+ if self.start_time_mjd > self.end_time_mjd:
112
+ raise WinterValidationError(
113
+ f"Start time ({self.start_time_mjd}) is "
114
+ f"after end time ({self.end_time_mjd})"
115
+ )
116
+
117
+ now = Time.now().mjd
118
+
119
+ if self.end_time_mjd < now:
120
+ raise WinterValidationError(
121
+ f"End date ({self.end_time_mjd}) is in the past, (time now is {now})"
122
+ )
123
+
124
+ return self
125
+
95
126
  @model_validator(mode="after")
96
127
  def validate_end_time(self):
97
128
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wintertoo
3
- Version: 1.6.1
3
+ Version: 1.6.2
4
4
  Author-email: Robert Stein <rdstein@caltech.edu>, Danielle Frostig <frostig@mit.edu>, Viraj Karambelkar <viraj@astro.caltech.edu>
5
5
  License: MIT
6
6
  Project-URL: homepage, https://github.com/winter-telescope/wintertoo
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes