Skip to content

Commit

Permalink
adding mwmvisit to file return path
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Dec 5, 2024
1 parent 60e9a3f commit 1358995
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/valis/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ class PipeFiles(BaseModel):
""" Pydantic model for lists of files """
boss: Optional[str] = None
apogee: Optional[str] = None
astra: Optional[str] = None
astra: Optional[list[str]] = None


class PipesModel(PeeweeBase):
Expand Down
3 changes: 2 additions & 1 deletion python/valis/db/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,8 @@ def get_pipe_meta(sdss_id: int, release: str, pipeline: str) -> dict:
# get astra pipeline target
elif pipeline == 'astra' and (qq := get_astra_target(sdss_id, release)):
res = qq.dicts().first()
return {pipeline: res, 'files': {pipeline: build_astra_path(res, release)}}
return {pipeline: res, 'files': {pipeline: [build_astra_path(res, release),
build_astra_path(res, release, name='mwmVisit')]}}


def get_target_pipeline(sdss_id: int, release: str, pipeline: str = 'all') -> dict:
Expand Down
7 changes: 5 additions & 2 deletions python/valis/utils/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def build_apogee_path(values: dict, release: str, ignore_existence: bool = False
ignore_existence=ignore_existence)


def build_astra_path(values: dict, release: str, ignore_existence: bool = False) -> str:
def build_astra_path(values: dict, release: str, name: str = 'mwmStar',
ignore_existence: bool = False) -> str:
""" Build an Astra mwmStar file path
Builds an Astra file path to the mwmStar file. It sets a default
Expand All @@ -168,6 +169,8 @@ def build_astra_path(values: dict, release: str, ignore_existence: bool = False)
the input data values to give to the path template
release : str
the data release
name : str
the name of the file product
ignore_existence : bool, optional
flag to ignore file existence and return path, by default False
Expand All @@ -176,5 +179,5 @@ def build_astra_path(values: dict, release: str, ignore_existence: bool = False)
str
the output file path
"""
return build_file_path(values, 'mwmStar', release, defaults={'component': ''},
return build_file_path(values, name, release, defaults={'component': ''},
ignore_existence=ignore_existence)

0 comments on commit 1358995

Please sign in to comment.