epiforecasts / covidregionaldata

An interface to subnational and national level COVID-19 data. For all countries supported, this includes a daily time-series of cases. Wherever available we also provide data on deaths, hospitalisations, and tests. National level data is also supported using a range of data sources as well as linelist data and links to intervention data sets.
https://epiforecasts.io/covidregionaldata/
Other
37 stars 18 forks source link

Integrate testing into DataClass #337

Closed seabbs closed 3 years ago

seabbs commented 3 years ago

Currently testing is standardised across all objects that inherit from data class. This standardised testing is then used to check the integrity of datasets with a daily check and also used with a data snapshot for unit testing.

Using our data sources I have found myself wanting to check the validity of our data sources. This makes me think the incorporating testing into the package either as a function or a class method (this would be nice as it would allow classes to inherit a standard set of whilst adding more to them.

Some things to work on with this:

joseph-palmer commented 3 years ago

So have a test method defined in the generic class (DataClass or CountryDataClass) and then the test functions will just call the test from each country (Italy$run_tests()). Then if a country has some specific tests to add it can define its own test to overwtire the parent (whilst still calling it so it can add extra), so for UK it might be

run_tests <- function() {
  super$run_tests()
  ....
}
seabbs commented 3 years ago

Yes that is exactly what I was thinking (though test as the method name 😄 )