|
20 | 20 | solve_executions, |
21 | 21 | solve_required_executions, |
22 | 22 | ) |
23 | | -from climate_ref_core.constraints import AddSupplementaryDataset, RequireFacets, SelectParentExperiment |
| 23 | +from climate_ref_core.constraints import AddParentDataset, AddSupplementaryDataset, RequireFacets |
24 | 24 | from climate_ref_core.datasets import SourceDatasetType |
25 | 25 | from climate_ref_core.diagnostics import DataRequirement, FacetFilter |
26 | 26 |
|
@@ -188,35 +188,40 @@ def test_solver_build_from_db(self, solver): |
188 | 188 | DataRequirement( |
189 | 189 | source_type=SourceDatasetType.CMIP6, |
190 | 190 | filters=(FacetFilter(facets={"variable_id": ("tas", "pr")}),), |
191 | | - constraints=(SelectParentExperiment(),), |
| 191 | + constraints=(AddParentDataset(),), |
192 | 192 | group_by=("variable_id", "experiment_id"), |
193 | 193 | ), |
194 | 194 | pd.DataFrame( |
195 | 195 | { |
196 | | - "variable_id": ["tas", "tas"], |
197 | 196 | "experiment_id": ["ssp119", "historical"], |
| 197 | + "grid_label": ["gn", "gn"], |
198 | 198 | "parent_experiment_id": ["historical", "none"], |
| 199 | + "parent_source_id": ["A", "A"], |
| 200 | + "parent_variant_label": ["r1i1p1f1", "none"], |
| 201 | + "source_id": ["A", "A"], |
| 202 | + "table_id": ["Amon", "Amon"], |
| 203 | + "variable_id": ["tas", "tas"], |
| 204 | + "variant_label": ["r1i1p1f1", "r1i1p1f1"], |
| 205 | + "version": ["v20210101", "v20220101"], |
199 | 206 | } |
200 | 207 | ), |
201 | 208 | { |
202 | 209 | (("variable_id", "tas"), ("experiment_id", "ssp119")): pd.DataFrame( |
203 | 210 | { |
| 211 | + "experiment_id": ["ssp119", "historical"], |
| 212 | + "grid_label": ["gn", "gn"], |
| 213 | + "parent_experiment_id": ["historical", "none"], |
| 214 | + "parent_source_id": ["A", "A"], |
| 215 | + "parent_variant_label": ["r1i1p1f1", "none"], |
| 216 | + "source_id": ["A", "A"], |
| 217 | + "table_id": ["Amon", "Amon"], |
204 | 218 | "variable_id": ["tas", "tas"], |
205 | | - "experiment_id": ["historical", "ssp119"], |
206 | | - }, |
207 | | - # The order of the rows is not guaranteed |
208 | | - index=[1, 0], |
209 | | - ), |
210 | | - (("variable_id", "tas"), ("experiment_id", "historical")): pd.DataFrame( |
211 | | - { |
212 | | - "variable_id": ["tas", "tas"], |
213 | | - "experiment_id": ["historical"], |
| 219 | + "variant_label": ["r1i1p1f1", "r1i1p1f1"], |
| 220 | + "version": ["v20210101", "v20220101"], |
214 | 221 | }, |
215 | | - # The order of the rows is not guaranteed |
216 | | - index=[1, 0], |
| 222 | + index=[0, 1], |
217 | 223 | ), |
218 | 224 | }, |
219 | | - marks=[pytest.mark.xfail(reason="Parent experiment not implemented")], |
220 | 225 | id="parent", |
221 | 226 | ), |
222 | 227 | pytest.param( |
|
0 commit comments