This is an automated email from the ASF dual-hosted git repository.

eamonford pushed a commit to branch support-deseason
in repository https://gitbox.apache.org/repos/asf/incubator-sdap-nexus.git


The following commit(s) were added to refs/heads/support-deseason by this push:
     new 145acbb  cleanup
145acbb is described below

commit 145acbba4102101b927f4c2ec73ef29ff63727b5
Author: Eamon Ford <[email protected]>
AuthorDate: Tue Oct 13 13:52:13 2020 -0700

    cleanup
---
 analysis/webservice/algorithms_spark/TimeSeriesSpark.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/analysis/webservice/algorithms_spark/TimeSeriesSpark.py 
b/analysis/webservice/algorithms_spark/TimeSeriesSpark.py
index 4ca8f88..422fdb8 100644
--- a/analysis/webservice/algorithms_spark/TimeSeriesSpark.py
+++ b/analysis/webservice/algorithms_spark/TimeSeriesSpark.py
@@ -38,6 +38,7 @@ from webservice.webmodel import NexusResults, 
NoDataException, NexusProcessingEx
 
 EPOCH = timezone('UTC').localize(datetime(1970, 1, 1))
 ISO_8601 = '%Y-%m-%dT%H:%M:%S%z'
+SECONDS_IN_ONE_YEAR = 31535999
 
 logger = logging.getLogger(__name__)
 
@@ -211,7 +212,7 @@ class TimeSeriesSparkHandlerImpl(NexusCalcSparkHandler):
                                                                                
    bounding_polygon.bounds[2],
                                                                                
    shortName_clim,
                                                                                
    0,
-                                                                               
    31535999,
+                                                                               
    SECONDS_IN_ONE_YEAR,
                                                                                
    metrics_callback=metrics_record.record_metrics)
                 if len(daysinrange_clim) == 0:
                     raise NexusProcessingException(reason="There is no 
climatology data present for dataset " + shortName + ".") 
@@ -222,8 +223,7 @@ class TimeSeriesSparkHandlerImpl(NexusCalcSparkHandler):
                                                metrics_record.record_metrics,
                                                spark_nparts=spark_nparts,
                                                sc=self._sc)
-                clim_indexed_by_month = {datetime.utcfromtimestamp(
-                    result['time']).month: result for result in results_clim}
+                clim_indexed_by_month = 
{datetime.utcfromtimestamp(result['time']).month: result for result in 
results_clim}
                 if len(clim_indexed_by_month) < 12:
                     raise NexusProcessingException(reason="There are only " +
                                                    len(clim_indexed_by_month) 
+ " months of climatology data for dataset " + 

Reply via email to