climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject [01/10] climate git commit: CLIMATE-638 - Fix urllib import and minor clean up
Date Fri, 05 Jun 2015 15:50:08 GMT
Repository: climate
Updated Branches:
  refs/heads/master 82dd6b69d -> fe190b636


CLIMATE-638 - Fix urllib import and minor clean up


Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/59c70625
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/59c70625
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/59c70625

Branch: refs/heads/master
Commit: 59c70625d5f947f50061c8a84fabcd48b2e9d04c
Parents: 82dd6b6
Author: Michael Joyce <joyce@apache.org>
Authored: Thu Jun 4 07:56:14 2015 -0700
Committer: Michael Joyce <joyce@apache.org>
Committed: Thu Jun 4 08:54:10 2015 -0700

----------------------------------------------------------------------
 examples/subregions_portrait_diagram.py | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/59c70625/examples/subregions_portrait_diagram.py
----------------------------------------------------------------------
diff --git a/examples/subregions_portrait_diagram.py b/examples/subregions_portrait_diagram.py
index e0d789a..075de2d 100644
--- a/examples/subregions_portrait_diagram.py
+++ b/examples/subregions_portrait_diagram.py
@@ -13,6 +13,7 @@ import numpy as np
 import numpy.ma as ma
 
 from os import path
+import urllib
 
 # File URL leader
 FILE_LEADER = "http://zipper.jpl.nasa.gov/dist/"
@@ -36,28 +37,22 @@ EVAL_BOUNDS = Bounds(LAT_MIN, LAT_MAX, LON_MIN, LON_MAX, START, END)
 varName = 'pr' 
 
 #regridding parameters
-gridLonStep=0.5
-gridLatStep=0.5
+gridLonStep = 0.5
+gridLatStep = 0.5
 
 #some vars for this evaluation
-target_datasets_ensemble=[]
-target_datasets =[]
-allNames =[]
+target_datasets_ensemble = []
+target_datasets = []
+allNames = []
 
 # Download necessary NetCDF file if not present
-if path.exists(FILE_1):
-    pass
-else:
+if not path.exists(FILE_1):
     urllib.urlretrieve(FILE_LEADER + FILE_1, FILE_1)
 
-if path.exists(FILE_2):
-    pass
-else:
+if not path.exists(FILE_2):
     urllib.urlretrieve(FILE_LEADER + FILE_2, FILE_2)
 
-if path.exists(FILE_3):
-    pass
-else:
+if not path.exists(FILE_3):
     urllib.urlretrieve(FILE_LEADER + FILE_3, FILE_3)
 
 """ Step 1: Load Local NetCDF File into OCW Dataset Objects and store in list"""


Mime
View raw message