CLIMATE-448 Use 'dateutil.relativedelta' to get 'next-month' datetime in decode_time_values' function and fixed unittest.
Project: http://git-wip-us.apache.org/repos/asf/climate/repo Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/435f49ad Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/435f49ad Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/435f49ad Branch: refs/heads/master Commit: 435f49ad99c904f5da523c0abb701ef300369df3 Parents: 866c161 Author: Maziyar Boustani <[email protected]> Authored: Thu May 29 13:44:39 2014 -0700 Committer: Maziyar Boustani <[email protected]> Committed: Thu May 29 13:44:39 2014 -0700 ---------------------------------------------------------------------- ocw/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/climate/blob/435f49ad/ocw/utils.py ---------------------------------------------------------------------- diff --git a/ocw/utils.py b/ocw/utils.py index da3dcc1..7abbbfd 100644 --- a/ocw/utils.py +++ b/ocw/utils.py @@ -50,7 +50,7 @@ def decode_time_values(dataset, time_var_name): # datetime.timedelta doesn't support a 'months' option. To remedy # this, a month == 30 days for our purposes. for time_val in time_data: - times.append(time_base + relativedelta(months = int(time_val))) + times.append(time_base + relativedelta(months=int(time_val))) else: for time_val in time_data: arg[time_units] = time_val
