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

Gb/bug #182

Merged
merged 3 commits into from
Feb 2, 2024
Merged
Changes from 1 commit
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
Next Next commit
fixed nc topo exo handler which needs to have same init args and kwar…
…gs for signature parsing
  • Loading branch information
grantbuster committed Feb 2, 2024
commit cd82016662a88237511ad54fda14ffc9d64b3d1e
34 changes: 17 additions & 17 deletions sup3r/preprocessing/data_handling/exo_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def __init__(self,
self.shape = shape
self.res_kwargs = res_kwargs

# for subclasses
self._source_handler = None

if input_handler is None:
in_type = get_source_type(file_paths)
if in_type == 'nc':
Expand Down Expand Up @@ -566,23 +569,20 @@ def get_cache_file(self, feature, s_enhance, t_enhance, t_agg_factor):
class TopoExtractNC(TopoExtractH5):
"""TopoExtract for netCDF files"""

def __init__(self, *args, **kwargs):
"""Parameters
----------
args : list
Same positional arguments as TopoExtract
kwargs : dict
Same keyword arguments as TopoExtract
"""
super().__init__(*args, **kwargs)
logger.info('Getting topography for full domain from '
f'{self._exo_source}')
self.source_handler = DataHandlerNC(
self._exo_source,
features=['topography'],
worker_kwargs={'ti_workers': self.ti_workers},
val_split=0.0,
)
@property
def source_handler(self):
"""Get the DataHandlerNC object that handles the .nc source topography
data file."""
if self._source_handler is None:
logger.info('Getting topography for full domain from '
f'{self._exo_source}')
self._source_handler = DataHandlerNC(
self._exo_source,
features=['topography'],
worker_kwargs={'ti_workers': self.ti_workers},
val_split=0.0,
)
return self._source_handler

@property
def source_data(self):
Expand Down