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

@@ -32,7 +32,7 @@ WINTER_BASE_WIDTH = 1.0
32
32
 
33
33
  MAX_TARGNAME_LEN = 30
34
34
 
35
- WinterImageTypes = Literal["exposure", "raw", "science", "stack", "diff"]
35
+ WinterImageTypes = Literal["exposure", "raw", "science", "stack", "diff", "avro"]
36
36
  DEFAULT_IMAGE_TYPE = "stack"
37
37
 
38
38
  PROGRAM_DB_HOST = "jagati.caltech.edu"
wintertoo/models/image.py CHANGED
@@ -6,7 +6,7 @@ from typing import Optional
6
6
 
7
7
  from astropy import units as u
8
8
  from astropy.time import Time
9
- from pydantic import BaseModel, Field, model_validator
9
+ from pydantic import AliasChoices, BaseModel, Field, model_validator
10
10
 
11
11
  from wintertoo.data import DEFAULT_IMAGE_TYPE, MAX_TARGNAME_LEN, WinterImageTypes
12
12
  from wintertoo.errors import WinterValidationError
@@ -31,16 +31,18 @@ class ProgramImageQuery(BaseModel):
31
31
  )
32
32
  start_date: int = Field(
33
33
  title="Start date for images",
34
- default=get_date(Time.now() - 30.0 * u.day),
34
+ default=None,
35
35
  examples=[get_date(Time.now() - 30.0 * u.day), "20230601"],
36
36
  )
37
37
  end_date: int = Field(
38
38
  title="End date for images",
39
- default=get_date(Time.now()),
39
+ default=None,
40
40
  examples=[get_date(Time.now() - 30.0 * u.day), get_date(Time.now())],
41
41
  )
42
- kind: WinterImageTypes = Field(
43
- default=DEFAULT_IMAGE_TYPE, example="raw/science/diff"
42
+ image_type: WinterImageTypes = Field(
43
+ default=DEFAULT_IMAGE_TYPE,
44
+ example="raw/science/diff",
45
+ validation_alias=AliasChoices("image_type", "kind"),
44
46
  )
45
47
 
46
48
  @model_validator(mode="after")
@@ -50,6 +52,12 @@ class ProgramImageQuery(BaseModel):
50
52
 
51
53
  :return: validated field value
52
54
  """
55
+ if self.start_date is None:
56
+ self.start_date = get_date(Time.now() - 30.0 * u.day)
57
+
58
+ if self.end_date is None:
59
+ self.end_date = get_date(Time.now())
60
+
53
61
  if self.start_date > self.end_date:
54
62
  raise WinterValidationError("Start date is after end date")
55
63
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wintertoo
3
- Version: 1.4.0
3
+ Version: 1.5.1
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
@@ -6,16 +6,16 @@ wintertoo/schedule.py,sha256=0nqOh_Ih4Ce0UMVXIzU2SfhdibFfKciPqQhEiAG9iyU,5813
6
6
  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
- wintertoo/data/__init__.py,sha256=7998yomm2Kb0_687D82tjIhqwO-LOh7pru1sNUC1wI0,1594
9
+ wintertoo/data/__init__.py,sha256=OPsHalwB9mTMBHp-W-iAbsP39hrgQ4myNt1Daxkwz2s,1602
10
10
  wintertoo/data/observing_request_schema.json,sha256=00laKF0S5O6lolsUrimReR67gymCEJuH4z3u6PUFgFA,1733
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
- wintertoo/models/image.py,sha256=YNX9a5nwAjWw2disbyNbrDsJUhmMwIuBedTGScCzlD4,3836
14
+ wintertoo/models/image.py,sha256=VdlyF_goBMzmAmMHSIevEbheQOLMzFdxz10AK5Wwmqw,4066
15
15
  wintertoo/models/program.py,sha256=mtewVnt7NxSK0hxX8aUO8qehEtOi_Cieli4voCCRh4I,1804
16
16
  wintertoo/models/too.py,sha256=SXaAx_nkPyqYaUS7UChA86TkeKrIOqvxccrNXaXXvbo,6098
17
- wintertoo-1.4.0.dist-info/LICENSE,sha256=1-4yY2S7St-8Koy4JGheNG9QPkwff7831u2JITQ2oQs,1063
18
- wintertoo-1.4.0.dist-info/METADATA,sha256=lwdAbJjRyhk_7R7Kgjc2ZV-hPTcOTbUTZZe-E-qzZMQ,2498
19
- wintertoo-1.4.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
20
- wintertoo-1.4.0.dist-info/top_level.txt,sha256=6SMjMBzaNrD77erdCiVcRTrPZ-x98SDX43akRjWj4T8,10
21
- wintertoo-1.4.0.dist-info/RECORD,,
17
+ wintertoo-1.5.1.dist-info/LICENSE,sha256=1-4yY2S7St-8Koy4JGheNG9QPkwff7831u2JITQ2oQs,1063
18
+ wintertoo-1.5.1.dist-info/METADATA,sha256=BAnnPf7BuqE-XwY6w9o1eRFHv1VyT8TlObHvhN9-t0k,2498
19
+ wintertoo-1.5.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
20
+ wintertoo-1.5.1.dist-info/top_level.txt,sha256=6SMjMBzaNrD77erdCiVcRTrPZ-x98SDX43akRjWj4T8,10
21
+ wintertoo-1.5.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5