You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@climate.apache.org by kwhitehall <gi...@git.apache.org> on 2015/03/22 18:33:34 UTC

[GitHub] climate pull request: Climate 598

GitHub user kwhitehall opened a pull request:

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

    Climate 598

    

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

    $ git pull https://github.com/kwhitehall/climate CLIMATE-598

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

    https://github.com/apache/climate/pull/183.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 #183
    
----
commit 7af376c6538823d4cea3aa2b732e1bfbb034df26
Author: Kim Whitehall <ki...@jpl.nasa.gov>
Date:   2015-03-22T17:23:20Z

    Update the times array of the DS object when monthly climo is calculated
    
    Update docs

commit 8095ea88e96192b60de98939bbcf195f26865531
Author: Kim Whitehall <ki...@jpl.nasa.gov>
Date:   2015-03-22T17:23:48Z

    Update the nosetests to test times array

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85082737
  
     Merged build triggered. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85082813
  
    Merged build started. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by kwhitehall <gi...@git.apache.org>.
Github user kwhitehall commented on a diff in the pull request:

    https://github.com/apache/climate/pull/183#discussion_r27177986
  
    --- Diff: ocw/utils.py ---
    @@ -335,5 +337,11 @@ def calc_climatology_monthly(dataset):
             )
             raise ValueError(error)
         else:
    -        return reshape_monthly_to_annually(dataset).mean(axis=0)
    +        values = reshape_monthly_to_annually(dataset).mean(axis=0)
    +        
    +        # A year can commence from any month
    +        first_month = dataset.times[0].month
    --- End diff --
    
    Hey Mike,
    Not necessarily of a particular year, but of a year. So, for e.g. if 3 years Jan -Dec of data the times should reflect 12 months Jan - Dec, if the 3years were from March - Feb then the times should reflect 12 months March - Feb 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85087124
  
    Merged build finished. Test Passed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-84663334
  
    Merged build finished. Test Passed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85083994
  
    Merged build finished. Test Passed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-84663141
  
    Merged build started. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-86404174
  
    Merged build finished. Test Passed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by MJJoyce <gi...@git.apache.org>.
Github user MJJoyce commented on a diff in the pull request:

    https://github.com/apache/climate/pull/183#discussion_r27176530
  
    --- Diff: ocw/utils.py ---
    @@ -274,7 +273,7 @@ def calc_climatology_year(dataset):
         else:
             # Get values reshaped to (num_year, 12, num_lats, num_lons)
             values = reshape_monthly_to_annually(dataset)
    -        # Calculate mean values over year (num_year, num_lats, num_lons)
    +       # Calculate mean values over year (num_year, num_lats, num_lons)
    --- End diff --
    
    Hey Kim, can we fix this typo/accidental indentation problem here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by MJJoyce <gi...@git.apache.org>.
Github user MJJoyce commented on a diff in the pull request:

    https://github.com/apache/climate/pull/183#discussion_r27176710
  
    --- Diff: ocw/utils.py ---
    @@ -335,5 +337,11 @@ def calc_climatology_monthly(dataset):
             )
             raise ValueError(error)
         else:
    -        return reshape_monthly_to_annually(dataset).mean(axis=0)
    +        values = reshape_monthly_to_annually(dataset).mean(axis=0)
    +        
    +        # A year can commence from any month
    +        first_month = dataset.times[0].month
    --- End diff --
    
    Hey Kim,
    
    Just to make sure I understand what's going on here. You're trying to end up with an array that contains all the months for a particular year right? This is going to carry over into a following year. Is that going to be problematic or do we just not care?
    
    Also, being totally nitpicky but ```relativedelta(months=x)``` is better since it's a keyword arg and we don't put spaces around those. Easy enough to fix later though. =D


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by kwhitehall <gi...@git.apache.org>.
Github user kwhitehall commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85080574
  
    Ack. My bad! I'll clean it up.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85086797
  
     Merged build triggered. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-85086830
  
    Merged build started. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-86402835
  
     Merged build triggered. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-84663100
  
     Merged build triggered. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by MJJoyce <gi...@git.apache.org>.
Github user MJJoyce commented on a diff in the pull request:

    https://github.com/apache/climate/pull/183#discussion_r27178354
  
    --- Diff: ocw/utils.py ---
    @@ -335,5 +337,11 @@ def calc_climatology_monthly(dataset):
             )
             raise ValueError(error)
         else:
    -        return reshape_monthly_to_annually(dataset).mean(axis=0)
    +        values = reshape_monthly_to_annually(dataset).mean(axis=0)
    +        
    +        # A year can commence from any month
    +        first_month = dataset.times[0].month
    --- End diff --
    
    Cool cool, sounds good then =D


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by MJJoyce <gi...@git.apache.org>.
Github user MJJoyce commented on a diff in the pull request:

    https://github.com/apache/climate/pull/183#discussion_r26949177
  
    --- Diff: ocw/utils.py ---
    @@ -312,19 +314,29 @@ def calc_climatology_season(month_start, month_end, dataset):
         
         t_series = reshape_data[:, month_index].mean(axis=1)
         means = t_series.mean(axis=0)
    +    
         return t_series, means
     
     
     def calc_climatology_monthly(dataset):
         ''' Calculate monthly mean values for a dataset.
    +    Follow COARDS climo stats calculation, the year can be given as 0 
    +    but the min year allowed in Python is 1
    +    http://www.cgd.ucar.edu/cms/eaton/netcdf/CF-20010629.htm#climatology
     
         :param dataset: Monthly binned Dataset object with the number of months
             divisible by 12
         :type dataset: :class:`dataset.Dataset`
     
    -    :returns: Mean values for each month of the year
    +    :returns: Mean values for each month of the year and times
         :rtype: A 3D :class:`numpy.ndarray` of shape (12, num_lats, num_lons)
     
    +    :returns: Dataset times array of length 12)
    --- End diff --
    
    Hey Kim. It looks like you have a lot of duplication here. For explaining what this returns just stick with one returns/rtype block. For instance:
    
    ```
    :returns: Mean values for each month of the ..
    :rtype: Tuple of the form (values, times) where values is a blah blah blah
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] climate pull request: CLIMATE-598 - Update time attribute of Datas...

Posted by OCWJenkins <gi...@git.apache.org>.
Github user OCWJenkins commented on the pull request:

    https://github.com/apache/climate/pull/183#issuecomment-86402895
  
    Merged build started. Test Failed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---