reconhub / incidence

☣:chart_with_upwards_trend::chart_with_downwards_trend:☣ Compute and visualise incidence
https://reconhub.github.io/incidence
Other
58 stars 13 forks source link

Warn if (max(date) - min(date)) > 50 years? #81

Closed dirkschumacher closed 5 years ago

dirkschumacher commented 5 years ago

I just had a case where some dates were not parsed correctly and ended up with a year > 3000. This slowed down the plot function quite a bit and might not be easy to debug for new users.

An outbreak going on for multiple decades is very unlikely. Often in those cases there is an error in the data. Incidence could warn the users if the timeframe spans multiple years. This check could be disabled.

Just an idea.

zkamvar commented 5 years ago

I think this is a good idea. It's not too expensive to implement and it also gives the user a quick and flexible way to enforce the cromulence of their data.

the way I'm implementing it is to create an internal function that will check the date range against an option called incidence.max.days, which is set to 18262 days by default. This way, the user can set their own definition of what they expect in terms of the maximum number of days any given outbreak is expected to carry on for in one line at the top of their script.