You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/02/26 13:29:18 UTC

[jira] [Commented] (CLIMATE-759) Fix failing tests in test_dataset_processor.py

    [ https://issues.apache.org/jira/browse/CLIMATE-759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15168891#comment-15168891 ] 

ASF GitHub Bot commented on CLIMATE-759:
----------------------------------------

GitHub user jarifibrahim opened a pull request:

    https://github.com/apache/climate/pull/312

    fix issue CLIMATE-759

    The `_rcmes_calc_average_on_new_time_unit_K(data, dates, unit)` function in `dataset_processor.py` required the `unit` to be `full` or `annual` or `monthly` or `daily`. The tests were failing due to the values returned by the function. On error it returned `-1, -1, -1, -1` when it should return `-1, -1` 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jarifibrahim/climate CLIMATE-759

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/climate/pull/312.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #312
    
----
commit bed008cba2e2762b85c2318b6e7c81b2d29738d7
Author: Ibrahim <ja...@gmail.com>
Date:   2016-02-26T12:24:26Z

    fix issue CLIMATE-759

----


> Fix failing tests in test_dataset_processor.py
> ----------------------------------------------
>
>                 Key: CLIMATE-759
>                 URL: https://issues.apache.org/jira/browse/CLIMATE-759
>             Project: Apache Open Climate Workbench
>          Issue Type: Sub-task
>          Components: tests
>            Reporter: Lewis John McGibbney
>             Fix For: 1.1
>
>
> {code}
> ======================================================================
> ERROR: test_daily_to_annual_rebin (ocw.tests.test_dataset_processor.TestTemporalRebin)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/climate/ocw/tests/test_dataset_processor.py", line 85, in test_daily_to_annual_rebin
>     annual_dataset = dp.temporal_rebin(self.two_years_daily_dataset, datetime.timedelta(days=366))
>   File "/usr/local/climate/ocw/dataset_processor.py", line 122, in temporal_rebin
>     binned_values, binned_dates = _rcmes_calc_average_on_new_time_unit(target_dataset.values, target_dataset.times, temporal_resolution)
> ValueError: too many values to unpack
> -------------------- >> begin captured stdout << ---------------------
> Error: unknown unit type selected for time averaging: EXIT
> --------------------- >> end captured stdout << ----------------------
> ======================================================================
> ERROR: This test takes a really long time to run.  TODO: Figure out where the performance drag is
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/climate/ocw/tests/test_dataset_processor.py", line 78, in test_daily_to_monthly_rebin
>     monthly_dataset = dp.temporal_rebin(self.two_years_daily_dataset, datetime.timedelta(days=31))
>   File "/usr/local/climate/ocw/dataset_processor.py", line 122, in temporal_rebin
>     binned_values, binned_dates = _rcmes_calc_average_on_new_time_unit(target_dataset.values, target_dataset.times, temporal_resolution)
> ValueError: too many values to unpack
> -------------------- >> begin captured stdout << ---------------------
> Error: unknown unit type selected for time averaging: EXIT
> --------------------- >> end captured stdout << ----------------------
> ======================================================================
> ERROR: test_monthly_to_annual_rebin (ocw.tests.test_dataset_processor.TestTemporalRebin)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/climate/ocw/tests/test_dataset_processor.py", line 68, in test_monthly_to_annual_rebin
>     annual_dataset = dp.temporal_rebin(self.ten_year_monthly_dataset, datetime.timedelta(days=365))
>   File "/usr/local/climate/ocw/dataset_processor.py", line 122, in temporal_rebin
>     binned_values, binned_dates = _rcmes_calc_average_on_new_time_unit(target_dataset.values, target_dataset.times, temporal_resolution)
> ValueError: too many values to unpack
> -------------------- >> begin captured stdout << ---------------------
> Error: unknown unit type selected for time averaging: EXIT
> --------------------- >> end captured stdout << ----------------------
> ======================================================================
> ERROR: test_monthly_to_full_rebin (ocw.tests.test_dataset_processor.TestTemporalRebin)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/climate/ocw/tests/test_dataset_processor.py", line 72, in test_monthly_to_full_rebin
>     full_dataset = dp.temporal_rebin(self.ten_year_monthly_dataset, datetime.timedelta(days=3650))
>   File "/usr/local/climate/ocw/dataset_processor.py", line 122, in temporal_rebin
>     binned_values, binned_dates = _rcmes_calc_average_on_new_time_unit(target_dataset.values, target_dataset.times, temporal_resolution)
> ValueError: too many values to unpack
> -------------------- >> begin captured stdout << ---------------------
> Error: unknown unit type selected for time averaging: EXIT
> --------------------- >> end captured stdout << ----------------------
> ======================================================================
> ERROR: This will take a monthly dataset and ask for a monthly rebin of 28 days.  The resulting
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/climate/ocw/tests/test_dataset_processor.py", line 94, in test_non_rebin
>     monthly_dataset = dp.temporal_rebin(self.ten_year_monthly_dataset, datetime.timedelta(days=28))
>   File "/usr/local/climate/ocw/dataset_processor.py", line 122, in temporal_rebin
>     binned_values, binned_dates = _rcmes_calc_average_on_new_time_unit(target_dataset.values, target_dataset.times, temporal_resolution)
> ValueError: too many values to unpack
> -------------------- >> begin captured stdout << ---------------------
> Error: unknown unit type selected for time averaging: EXIT
> --------------------- >> end captured stdout << ----------------------
> ======================================================================
> ERROR: test_variable_propagation (ocw.tests.test_dataset_processor.TestTemporalRebin)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/local/climate/ocw/tests/test_dataset_processor.py", line 100, in test_variable_propagation
>     datetime.timedelta(days=365))
>   File "/usr/local/climate/ocw/dataset_processor.py", line 122, in temporal_rebin
>     binned_values, binned_dates = _rcmes_calc_average_on_new_time_unit(target_dataset.values, target_dataset.times, temporal_resolution)
> ValueError: too many values to unpack
> -------------------- >> begin captured stdout << ---------------------
> Error: unknown unit type selected for time averaging: EXIT
> --------------------- >> end captured stdout << ----------------------
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)