File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -95,10 +95,19 @@ def _parse_args(self) -> None:
95
95
"provided (assuming location is metrics/metric_name/run.py)."
96
96
),
97
97
)
98
+ parser .add_argument (
99
+ "--dataset" ,
100
+ type = str ,
101
+ required = False ,
102
+ default = "" ,
103
+ help = "The name of the dataset to compute the metric on. Runs on all "
104
+ "datasets if not provided." ,
105
+ )
98
106
99
107
# Parse the arguments
100
108
args = parser .parse_args ()
101
109
self .config_path = args .config_path
110
+ self .dataset_name = args .dataset
102
111
self .likely_dir = os .path .dirname (os .path .dirname (os .getcwd ()))
103
112
104
113
def _load_openlayer_json (self ) -> None :
@@ -122,6 +131,12 @@ def _load_datasets(self) -> None:
122
131
model = self .config ["model" ]
123
132
datasets_list = self .config ["datasets" ]
124
133
dataset_names = [dataset ["name" ] for dataset in datasets_list ]
134
+ if self .dataset_name :
135
+ if self .dataset_name not in dataset_names :
136
+ raise ValueError (
137
+ f"Dataset { self .dataset_name } not found in the openlayer.json."
138
+ )
139
+ dataset_names = [self .dataset_name ]
125
140
output_directory = model ["outputDirectory" ]
126
141
# Read the outputs directory for dataset folders. For each, load
127
142
# the config.json and the dataset.json files into a dict and a dataframe
You can’t perform that action at this time.
0 commit comments