You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by Michael Anderson <mi...@gmail.com> on 2017/11/22 15:31:20 UTC

Suggested Approach For: ValueError: ordinal must be >= 1 In ime_series_with_regions.py

See my full comments in the JIRA:
https://issues.apache.org/jira/browse/CLIMATE-934

More or less what is happening is the first date in the series is
01-01-01.  When figuring out the xticks / xtick labels for the time series,
matplotlib is subtracting some value from that date to calculate the view
min, but Epoch minus something is negative which results in trying to
convert a negative number to a date and the error is thrown.

If I update the example to shift the dates to the middle of the month it
works without error.

I could also change the utilscalc_climatology_monthly to return 01 - month
- mid point of month day which would be neater.  I could add an optional
parameter to use the first, mid or last day of the month to avoid breaking
anyone who expects it to be the first of the month.

I could also dig into the plotter.py and see if there is a switch to tell
it to apply the first xtick at 0 on the x rather than trying to calculate
the offset.

Feedback appreciated on the preferred approach.