Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error plotting empty timeseries #27

Open
duncanwp opened this issue Mar 10, 2020 · 0 comments
Open

Error plotting empty timeseries #27

duncanwp opened this issue Mar 10, 2020 · 0 comments

Comments

@duncanwp
Copy link
Member

When plotting a time-series with all the data-points masked matplotlib throws an error about the date conversion:

...
  File "/Users/watson-parris/miniconda3/envs/cis_env3/lib/python3.7/site-packages/cis/plotting/plot.py", line 126, in format_datetime
    date_time = num2date(x)
  File "/Users/watson-parris/miniconda3/envs/cis_env3/lib/python3.7/site-packages/matplotlib/dates.py", line 522, in num2date
    return _from_ordinalf(x, tz)
  File "/Users/watson-parris/miniconda3/envs/cis_env3/lib/python3.7/site-packages/matplotlib/dates.py", line 321, in _from_ordinalf
    'expects datetime objects.'.format(ix))
ValueError: Cannot convert -1 to a date.  This often happens if non-datetime values are passed to an axis that expects datetime objects.

CIS should catch this and produce an informative error when trying to plot empty datasets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant