[ https://issues.apache.org/jira/browse/CLIMATE-934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16262425#comment-16262425 ]
Michael Anderson edited comment on CLIMATE-934 at 11/22/17 12:42 PM: --------------------------------------------------------------------- I've updated it on my local and will submit. Still working on the matlib bit. utils.calc_climatology_monthly returns [datetime.datetime(1, 1, 1, 0, 0) datetime.datetime(1, 2, 1, 0, 0) datetime.datetime(1, 3, 1, 0, 0) datetime.datetime(1, 4, 1, 0, 0) datetime.datetime(1, 5, 1, 0, 0) datetime.datetime(1, 6, 1, 0, 0) datetime.datetime(1, 7, 1, 0, 0) datetime.datetime(1, 8, 1, 0, 0) datetime.datetime(1, 9, 1, 0, 0) datetime.datetime(1, 10, 1, 0, 0) datetime.datetime(1, 11, 1, 0, 0) datetime.datetime(1, 12, 1, 0, 0)] which is what matplotlib is having a hard time converting to dates. I forced the year to be 2017 and it worked. The matplotlib docs state: Matplotlib provides sophisticated date plotting capabilities, standing on the shoulders of python datetime, the add-on modules pytz and dateutil. datetime objects are converted to floating point numbers which represent time in days since 0001-01-01 UTC, plus 1. was (Author: michael.arthur.ander...@gmail.com): I've updated it on my local and will submit. Still working on the matlib bit. utils.calc_climatology_monthly returns [datetime.datetime(1, 1, 1, 0, 0) datetime.datetime(1, 2, 1, 0, 0) datetime.datetime(1, 3, 1, 0, 0) datetime.datetime(1, 4, 1, 0, 0) datetime.datetime(1, 5, 1, 0, 0) datetime.datetime(1, 6, 1, 0, 0) datetime.datetime(1, 7, 1, 0, 0) datetime.datetime(1, 8, 1, 0, 0) datetime.datetime(1, 9, 1, 0, 0) datetime.datetime(1, 10, 1, 0, 0) datetime.datetime(1, 11, 1, 0, 0) datetime.datetime(1, 12, 1, 0, 0)] which is what matlib is having a hard time converting to dates. I forced the year to be 2017 and it worked. > time_series_with_regions.py Fails With Type Error > ------------------------------------------------- > > Key: CLIMATE-934 > URL: https://issues.apache.org/jira/browse/CLIMATE-934 > Project: Apache Open Climate Workbench > Issue Type: Bug > Components: examples > Affects Versions: 1.1.0 > Reporter: Michael Anderson > Assignee: Michael Anderson > > time_series_with_regions.py Fails With: > Traceback (most recent call last): > File "time_series_with_regions.py", line 122, in <module> > Bounds(-10.0, 0.0, 29.0, 36.5), > File "/Users/michaelanderson/Downloads/climate/ocw/dataset.py", line 351, > in __init__ > if boundary_type[:6].upper() == 'CORDEX': > TypeError: 'float' object has no attribute '__getitem__' > The example is constructing the Bounds object like so: > Bounds(-10.0, 0.0, 29.0, 36.5), > However the Bounds constructor looks like so: > def __init__(self, boundary_type='rectangular', > us_states=None, countries=None, > user_mask_file=None, mask_variable_name=None, > longitude_name=None, latitude_name=None, > lat_min=-90, lat_max=90, lon_min=-180, lon_max=180, > start=None, end=None): > So when the Bounds constructor gets here: > if boundary_type[:6].upper() == 'CORDEX': > It is trying to treat an int like an array. -- This message was sent by Atlassian JIRA (v6.4.14#64029)