From fe65a4d95ae6dcabd21f08b780537c471d061435 Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Fri, 26 Jul 2024 10:43:45 +0200 Subject: [PATCH] cleanup for datastore examples --- neural_lam/datastore/npyfiles/config.py | 14 +------------- neural_lam/train_model.py | 8 +++----- .../.gitignore | 0 .../mllam/.gitignore | 0 .../mllam/example.danra.yaml | 0 .../multizarr/data_config.yaml | 0 6 files changed, 4 insertions(+), 18 deletions(-) rename tests/{datastore_configs => datastores_examples}/.gitignore (100%) rename tests/{datastore_configs => datastores_examples}/mllam/.gitignore (100%) rename tests/{datastore_configs => datastores_examples}/mllam/example.danra.yaml (100%) rename tests/{datastore_configs => datastores_examples}/multizarr/data_config.yaml (100%) diff --git a/neural_lam/datastore/npyfiles/config.py b/neural_lam/datastore/npyfiles/config.py index 545b4b8b..afb08c77 100644 --- a/neural_lam/datastore/npyfiles/config.py +++ b/neural_lam/datastore/npyfiles/config.py @@ -18,7 +18,7 @@ class Projection: kwargs: A dictionary of keyword arguments specific to the projection type. """ - class_name: str # = field(metadata={'data_key': 'class'}) + class_name: str kwargs: Dict[str, Any] @@ -56,15 +56,3 @@ class NpyDatastoreConfig(dataclass_wizard.YAMLWizard): dataset: Dataset grid_shape_state: List[int] projection: Projection - - -class NpyConfig: - """Class for loading configuration files. - - This class loads a configuration file and provides a way to access - its values as attributes. - """ - - def num_data_vars(self): - """Return the number of data variables for a given key.""" - return len(self.dataset.var_names) diff --git a/neural_lam/train_model.py b/neural_lam/train_model.py index 39f0cbdf..ffd9bb67 100644 --- a/neural_lam/train_model.py +++ b/neural_lam/train_model.py @@ -44,16 +44,14 @@ def main(input_args=None): description="Train or evaluate NeurWP models for LAM" ) parser.add_argument( - "--datastore-kind", + "datastore-kind", type=str, choices=["multizarr", "npyfiles", "mllam"], - default="multizarr", - help="Kind of datastore to use (default: multizarr)", + help="Kind of datastore to use", ) parser.add_argument( - "--datastore-path", + "datastore-path", type=str, - default="tests/datastore_configs/multizarr", help="The root path for the datastore", ) parser.add_argument( diff --git a/tests/datastore_configs/.gitignore b/tests/datastores_examples/.gitignore similarity index 100% rename from tests/datastore_configs/.gitignore rename to tests/datastores_examples/.gitignore diff --git a/tests/datastore_configs/mllam/.gitignore b/tests/datastores_examples/mllam/.gitignore similarity index 100% rename from tests/datastore_configs/mllam/.gitignore rename to tests/datastores_examples/mllam/.gitignore diff --git a/tests/datastore_configs/mllam/example.danra.yaml b/tests/datastores_examples/mllam/example.danra.yaml similarity index 100% rename from tests/datastore_configs/mllam/example.danra.yaml rename to tests/datastores_examples/mllam/example.danra.yaml diff --git a/tests/datastore_configs/multizarr/data_config.yaml b/tests/datastores_examples/multizarr/data_config.yaml similarity index 100% rename from tests/datastore_configs/multizarr/data_config.yaml rename to tests/datastores_examples/multizarr/data_config.yaml