Closed BSchilperoort closed 2 years ago
I think #50 would solve this issue, right? The way I see it, the calendar is just a means to easily generate a calendar, and it might be best if it never stores anything, but rather poops out calendars in the form of pandas dataframes that are passed on to other functions. With #50 and #53, we're already stripping functionality of the calendar which enables such a simplification of the calendar's purpose.
With PR #23 the intervals are stored in the
AdventCalendar
object, and themap_to_years
function returnsself
(i.e., the calendar) instead of just intervals.Previous functionality
Previously data resampling data was performed in the following way:
And the
map_years
method allowed users to preview what the intervals would look like for the given years.Current functionality
With the new changes, the calendar including the generated intervals are returned when calling
map_years
:However, when the user then resamples data,
map_to_data
is called internally, and the intervals the user generated are never used. The above code block functions the exact same when the second line is removed, as in theresample
methodmap_to_data
will callmap_years
, ignoring any previously set intervals.Expected functionality (from my perspective)
It could be more clear to actually use the intervals the user generates for resampling data. This makes sure that intervals are only, and explicitly, generated in a single place.
If the user did not generate any intervals:
If the data does not fully cover the generated intervals:
map_to_data
can still be used, but then as an alternative tomap_years
: