wintertoo 1.6.0__py3-none-any.whl → 1.6.2__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.

Potentially problematic release.


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

@@ -17,7 +17,7 @@
17
17
  "ditherNumber": {"type": "integer", "default": 8},
18
18
  "ditherStepSize": {"type": "number", "comment": "arcsec", "default": 90.0},
19
19
  "fieldID": {"type": "integer", "default": 999999999},
20
- "targName": {"type": ["string", "null"], "comment": "Target name e.g. GW170817", "default": null},
20
+ "targName": {"type": ["string"], "comment": "Target name e.g. GW170817"},
21
21
  "bestDetector": {"type": "boolean", "comment": "Center Ra/Dec of target on best detector", "default": true}
22
22
  },
23
23
  "required": [
wintertoo/models/too.py CHANGED
@@ -39,12 +39,11 @@ class ToORequest(BaseModel):
39
39
  title="Priority for target",
40
40
  ge=0.0,
41
41
  )
42
- target_name: Optional[str] = Field(
42
+ target_name: str = Field(
43
43
  title="Name of the target",
44
44
  min_length=1,
45
45
  max_length=MAX_TARGNAME_LEN,
46
46
  examples=["SN2021abc", "ZTF19aapreis"],
47
- default=get_default_value("targName"),
48
47
  )
49
48
  total_exposure_time: float = Field(
50
49
  default=get_default_value("visitExpTime"),
@@ -65,11 +64,14 @@ class ToORequest(BaseModel):
65
64
  get_default_value("ditherStepSize"), ge=0.0, title="dither distance (arcsec)"
66
65
  )
67
66
  start_time_mjd: Optional[float] = Field(
68
- default=Time.now().mjd + 0.01,
67
+ default=None,
69
68
  title="ToO validity start (MJD)",
69
+ example=Time.now().mjd,
70
70
  )
71
71
  end_time_mjd: Optional[float] = Field(
72
- 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)",
73
75
  )
74
76
  max_airmass: Optional[float] = Field(
75
77
  default=get_default_value("maxAirmass"),
@@ -93,6 +95,34 @@ class ToORequest(BaseModel):
93
95
  """
94
96
  return self.total_exposure_time / self.n_dither
95
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
+
96
126
  @model_validator(mode="after")
97
127
  def validate_end_time(self):
98
128
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wintertoo
3
- Version: 1.6.0
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
@@ -7,15 +7,15 @@ wintertoo/submit.py,sha256=kd6_aziOf5QcemsyyhSRSnbXlLj8OWsY1_Gj0ZXsUuo,3201
7
7
  wintertoo/utils.py,sha256=BWgBZoSX5xfqURb2Nkvf3i6A_IcVYU2SoXFvp6ez7Xc,3306
8
8
  wintertoo/validate.py,sha256=YpSABluVXxl33j_ht7TwfC-0SlN4IC0BnbbQiTwUk4c,10476
9
9
  wintertoo/data/__init__.py,sha256=OPsHalwB9mTMBHp-W-iAbsP39hrgQ4myNt1Daxkwz2s,1602
10
- wintertoo/data/observing_request_schema.json,sha256=PsQmSre-VpfCTwoo3Fc9VoPV4-mByLs6KYKZ7x5zzco,1733
10
+ wintertoo/data/observing_request_schema.json,sha256=HyPcP2ABRDdPmgdnPX4XP4H97DhnSqVhHUk9uDmUnos,1708
11
11
  wintertoo/data/summer_fields.txt,sha256=5Sc7MBUacelzaq1KHSLmfAyZ3WB5YifMNwKRjBRBcRk,52684603
12
12
  wintertoo/data/winter_fields.txt,sha256=TxySQTmJXCCgaf-oC1gzOYQb2Vr26KEKdJxqrZHHet0,3529364
13
13
  wintertoo/models/__init__.py,sha256=c2GEbIHvOT34IhpiMyqA7Tn83hEmnwx6Q7BuxURp97k,379
14
14
  wintertoo/models/image.py,sha256=VdlyF_goBMzmAmMHSIevEbheQOLMzFdxz10AK5Wwmqw,4066
15
15
  wintertoo/models/program.py,sha256=mtewVnt7NxSK0hxX8aUO8qehEtOi_Cieli4voCCRh4I,1804
16
- wintertoo/models/too.py,sha256=SXaAx_nkPyqYaUS7UChA86TkeKrIOqvxccrNXaXXvbo,6098
17
- wintertoo-1.6.0.dist-info/LICENSE,sha256=1-4yY2S7St-8Koy4JGheNG9QPkwff7831u2JITQ2oQs,1063
18
- wintertoo-1.6.0.dist-info/METADATA,sha256=ZR_BamQRW2Ie9JUYgvPrso09yzidNa46pC-D6_PIoGo,2513
19
- wintertoo-1.6.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
20
- wintertoo-1.6.0.dist-info/top_level.txt,sha256=6SMjMBzaNrD77erdCiVcRTrPZ-x98SDX43akRjWj4T8,10
21
- wintertoo-1.6.0.dist-info/RECORD,,
16
+ wintertoo/models/too.py,sha256=HIiTA8Ky9z6lheJHAgO2bitdC2j_CvVj2dLfTQgnAWQ,6891
17
+ wintertoo-1.6.2.dist-info/LICENSE,sha256=1-4yY2S7St-8Koy4JGheNG9QPkwff7831u2JITQ2oQs,1063
18
+ wintertoo-1.6.2.dist-info/METADATA,sha256=ZD6yQr5SMqwy0ZPGKSIsqB8EfCWv62YpxFlkVWBvAD4,2513
19
+ wintertoo-1.6.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
20
+ wintertoo-1.6.2.dist-info/top_level.txt,sha256=6SMjMBzaNrD77erdCiVcRTrPZ-x98SDX43akRjWj4T8,10
21
+ wintertoo-1.6.2.dist-info/RECORD,,