Skip to content

Commit

Permalink
Various small edits
Browse files Browse the repository at this point in the history
  • Loading branch information
dwest77a committed Jan 10, 2025
1 parent 39224a7 commit fc666e7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions padocc/core/mixins/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def cfa_path(self) -> str:
def zstore(self) -> Union[ZarrStore, None]:
"""
Retrieve a filehandler for the zarr store"""

if self.cloud_format != 'zarr':
return None

Expand Down
1 change: 1 addition & 0 deletions padocc/core/mixins/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def file_type(self, value):

type_map = {
'kerchunk': ['json','parq'],
'zarr':[None],
}

if self.cloud_format in type_map:
Expand Down
10 changes: 9 additions & 1 deletion padocc/core/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import Union

from .errors import error_handler
from .utils import extract_file, BypassSwitch, apply_substitutions, phases, file_configs
from .utils import extract_file, BypassSwitch, apply_substitutions, phases, file_configs, FILE_DEFAULT
from .logs import reset_file_handler

from .mixins import DirectoryMixin, DatasetHandlerMixin, StatusMixin, PropertiesMixin
Expand Down Expand Up @@ -155,6 +155,7 @@ def __init__(
self._kfile = None
self._kstore = None
self._zstore = None
self._cfa_dataset = None

self._is_trial = False

Expand Down Expand Up @@ -218,6 +219,13 @@ def run(
if dryrun is not None:
self._dryrun = dryrun

if self.cloud_format != mode:
self.logger.info(
f'Switching cloud format to {mode}'
)
self.cloud_format = mode
self.file_type = FILE_DEFAULT[mode]

try:
status = self._run(mode=mode, **kwargs)
self.save_files()
Expand Down
5 changes: 5 additions & 0 deletions padocc/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
'detail_cfg':DETAIL_CFG
}

FILE_DEFAULT = {
'kerchunk':'json',
'zarr':None,
}

class BypassSwitch:
"""Class to represent all bypass switches throughout the pipeline.
Requires a switch string which is used to enable/disable specific pipeline
Expand Down

0 comments on commit fc666e7

Please sign in to comment.