Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1.5.0 - Add avro image type #67

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "wintertoo"
version = "1.4.0"
version = "1.5.0"
description = ""
authors = [
{name = "Robert Stein", email = "[email protected]"},
Expand Down
2 changes: 1 addition & 1 deletion wintertoo/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

MAX_TARGNAME_LEN = 30

WinterImageTypes = Literal["exposure", "raw", "science", "stack", "diff"]
WinterImageTypes = Literal["exposure", "raw", "science", "stack", "diff", "avro"]
DEFAULT_IMAGE_TYPE = "stack"

PROGRAM_DB_HOST = "jagati.caltech.edu"
Expand Down
8 changes: 5 additions & 3 deletions wintertoo/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from astropy import units as u
from astropy.time import Time
from pydantic import BaseModel, Field, model_validator
from pydantic import AliasChoices, BaseModel, Field, model_validator

from wintertoo.data import DEFAULT_IMAGE_TYPE, MAX_TARGNAME_LEN, WinterImageTypes
from wintertoo.errors import WinterValidationError
Expand Down Expand Up @@ -39,8 +39,10 @@ class ProgramImageQuery(BaseModel):
default=get_date(Time.now()),
examples=[get_date(Time.now() - 30.0 * u.day), get_date(Time.now())],
)
kind: WinterImageTypes = Field(
default=DEFAULT_IMAGE_TYPE, example="raw/science/diff"
image_type: WinterImageTypes = Field(
default=DEFAULT_IMAGE_TYPE,
example="raw/science/diff",
validation_alias=AliasChoices("image_type", "kind"),
)

@model_validator(mode="after")
Expand Down
Loading