Re-write temporal_sampling
to directly return the period
#96
Labels
breaking
This will introduce a breaking change
clarity
Will increase clarity of source code
enhancement
New feature or request
temporal
Related with the Time dimension
In the source code at the moment we have
temporal_sampling
andtsamp2period
. The first returns a symbol, the other an actual period type likeMonth(1)
. However, in the code the period type is what we actually use, when we use it. The symbol is used only to make decisions onif
clauses. But because there is a unique and invertible mapping between the sampling symbol and the period type, we could just be using the period type instead.This means that we only need one function
temporal_sampling
that directly returns the period of sampling, with numbers, e.g.,Month(3)
is the "seasonal" period.This generalization means that we probably don't have to write so many different clauses of code for different types of averaging. I guess then weekly averaging would come naturally from a period if
Day(7)
, and seasonal comes fromMonth(3)
.I guess we could leave the inverse transform from period type to symbol/string for convenience.
The text was updated successfully, but these errors were encountered: