Esempio n. 1
0
 def test_one_phase(self, model):
     example_data = ExampleData()
     example_data.add(model)
     with pytest.raises(ValueError):
         example_data.subset()
     # Subset
     subset_df = example_data.subset(model=model)
     assert subset_df.columns.tolist() == Term.SUB_COLUMNS
     example_data.subset(country=model.NAME)
     example_data.subset_complement(model=model)
     example_data.records(model=model)
     # Specialized
     specialized_df = example_data.specialized(model=model)
     assert specialized_df.columns.tolist() == [Term.DATE, *model.VARIABLES]
     # Non-dimensional
     nondim_df = example_data.non_dim(model=model)
     assert nondim_df.columns.tolist() == model.VARIABLES
     assert round(nondim_df.sum().sum()) == len(nondim_df)
Esempio n. 2
0
 def test_subset(self):
     example_data = ExampleData()
     example_data.add(SIRF, country="Japan")
     example_data.subset(country="Japan")
     example_data.subset_complement(country="Japan")
     example_data.records(country="Japan")