scmdata.testing

Testing utilities

scmdata.testing.assert_scmdf_almost_equal(left, right, allow_unordered=False, check_ts_names=True, rtol=1e-05, atol=1e-08)[source]

Check that left and right ScmRun are equal.

Parameters
  • left (ScmRun) –

  • right (ScmRun) –

  • allow_unordered (bool) – If true, the order of the timeseries is not checked

  • check_ts_names (bool) – If true, check that the meta names are the same

  • rtol (float) – Relative tolerance on numeric comparisons

  • atol (float) – Absolute tolerance on numeric comparisons

Raises

AssertionErrorleft and right are not equal

scmdata.testing.get_single_ts(data=[1, 2, 3], index=[1, 2, 3], variable='Emissions|CO2', scenario='scen', model='mod', unit='GtC / yr', region='World', **kwargs)[source]

Create a sample ScmRun with a single timeseries

This function is used for testing with some sample metadata.