Skip to content

Commit

Permalink
clean up and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisblake committed May 31, 2024
1 parent 5f47157 commit 2773379
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
12 changes: 2 additions & 10 deletions pyaerocom/aeroval/_processing_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ def get_colocator(self, model_name: str = None, obs_name: str = None) -> Colocat
Colocator
"""
# LB: In general I don't like what this function is doing. Ideally define the Colocator object once and just use that.
col_cfg = {
**self.cfg.colocation_opts.model_dump()
} # LB: obs_vars is a list, should be a tuple
col_cfg = {**self.cfg.colocation_opts.model_dump()}
outdir = self.cfg.path_manager.get_coldata_dir()
col_cfg["basedir_coldata"] = outdir

Expand All @@ -127,7 +124,7 @@ def get_colocator(self, model_name: str = None, obs_name: str = None) -> Colocat

if model_name:
mod_cfg = self.cfg.get_model_entry(model_name)
col_cfg["model_cfg"] = mod_cfg # LB: this is untested and just a guess at this point
col_cfg["model_cfg"] = mod_cfg

# LB: Hack and at what lowlevel_helpers's import_from was doing
for key, val in mod_cfg.items():
Expand All @@ -143,11 +140,6 @@ def get_colocator(self, model_name: str = None, obs_name: str = None) -> Colocat
if key in ColocationSetup.model_fields:
col_cfg[key] = val

# col_stp = ColocationSetup(**col_cfg)
# col = Colocator(col_stp)
# col_cfg.add_meta
# col.import_from(obs_cfg) # LB: This is functionality might be needed. Want to get keys from the obs_cfg into ColocationSetup.
# col.colocation_setup.add_glob_meta(diurnal_only=self._get_diurnal_only(obs_name))
col_cfg["add_meta"].update(diurnal_only=self._get_diurnal_only(obs_name))

col_stp = ColocationSetup(**col_cfg)
Expand Down
2 changes: 1 addition & 1 deletion pyaerocom/aeroval/setupclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class OutputPaths(BaseModel):
project ID
exp_id : str
experiment ID
json_basedir : str
json_basedir : str, Path
"""

Expand Down
4 changes: 2 additions & 2 deletions pyaerocom/colocation_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ColocationSetup(BaseModel):
is ignored and only the config is used.
obs_id : str
ID of observation network to be used.
obs_vars : list
obs_vars : tuple[str, ...]
Variables to be analysed (need to be available in input obs dataset).
Variables that are not available in the model data output will be
skipped. Alternatively, model variables to be used for a given obs
Expand All @@ -97,7 +97,7 @@ class ColocationSetup(BaseModel):
(to be precise, if None, then
:attr:`pyaerocom.const.DEFAULT_REG_FILTER` is used which should
default to `ALL-wMOUNTAINS`, that is, no filtering).
basedir_coldata : str
basedir_coldata : str | Path
Base directory for storing of colocated data files.
save_coldata : bool
if True, colocated data objects are saved as NetCDF file.
Expand Down

0 comments on commit 2773379

Please sign in to comment.