You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by le...@apache.org on 2019/01/30 04:33:45 UTC
[1/2] climate git commit: added tempfile to get temp directory in
example
Repository: climate
Updated Branches:
refs/heads/master 4b342eff5 -> 8d9ef6534
added tempfile to get temp directory in example
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/28a4593c
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/28a4593c
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/28a4593c
Branch: refs/heads/master
Commit: 28a4593c634af40bf0385a8ae209ac0afa609d69
Parents: 4b342ef
Author: Mark Schnitzer <ma...@hotmail.com>
Authored: Tue Jan 22 09:36:17 2019 +0800
Committer: Mark Schnitzer <ma...@hotmail.com>
Committed: Tue Jan 22 09:36:17 2019 +0800
----------------------------------------------------------------------
examples/simple_model_to_model_bias.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/28a4593c/examples/simple_model_to_model_bias.py
----------------------------------------------------------------------
diff --git a/examples/simple_model_to_model_bias.py b/examples/simple_model_to_model_bias.py
index 8dc134d..ac55c37 100644
--- a/examples/simple_model_to_model_bias.py
+++ b/examples/simple_model_to_model_bias.py
@@ -55,6 +55,7 @@ import ocw.dataset_processor as dsp
import ocw.evaluation as evaluation
import ocw.metrics as metrics
import ocw.plotter as plotter
+import tempfile
if sys.version_info[0] >= 3:
from urllib.request import urlretrieve
@@ -72,8 +73,9 @@ FILE_2 = "AFRICA_UC-WRF311_CTL_ERAINT_MM_50km-rg_1989-2008_tasmax.nc"
# Filename for the output image/plot (without file extension)
OUTPUT_PLOT = "wrf_bias_compared_to_knmi"
-FILE_1_PATH = path.join('/tmp', FILE_1)
-FILE_2_PATH = path.join('/tmp', FILE_2)
+tempdir = tempfile.gettempdir()
+FILE_1_PATH = path.join(tempdir, FILE_1)
+FILE_2_PATH = path.join(tempdir, FILE_2)
if not path.exists(FILE_1_PATH):
urlretrieve(FILE_LEADER + FILE_1, FILE_1_PATH)
[2/2] climate git commit: added comment
Posted by le...@apache.org.
added comment
Project: http://git-wip-us.apache.org/repos/asf/climate/repo
Commit: http://git-wip-us.apache.org/repos/asf/climate/commit/8d9ef653
Tree: http://git-wip-us.apache.org/repos/asf/climate/tree/8d9ef653
Diff: http://git-wip-us.apache.org/repos/asf/climate/diff/8d9ef653
Branch: refs/heads/master
Commit: 8d9ef6534bbce700585ca95b247b4fb73debf0d6
Parents: 28a4593
Author: Mark Schnitzer <ma...@hotmail.com>
Authored: Tue Jan 22 09:49:18 2019 +0800
Committer: Mark Schnitzer <ma...@hotmail.com>
Committed: Tue Jan 22 09:49:18 2019 +0800
----------------------------------------------------------------------
examples/simple_model_to_model_bias.py | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/climate/blob/8d9ef653/examples/simple_model_to_model_bias.py
----------------------------------------------------------------------
diff --git a/examples/simple_model_to_model_bias.py b/examples/simple_model_to_model_bias.py
index ac55c37..4b77fe7 100644
--- a/examples/simple_model_to_model_bias.py
+++ b/examples/simple_model_to_model_bias.py
@@ -73,6 +73,7 @@ FILE_2 = "AFRICA_UC-WRF311_CTL_ERAINT_MM_50km-rg_1989-2008_tasmax.nc"
# Filename for the output image/plot (without file extension)
OUTPUT_PLOT = "wrf_bias_compared_to_knmi"
+# Retrieve the local model files into the OS-aware temp directory.
tempdir = tempfile.gettempdir()
FILE_1_PATH = path.join(tempdir, FILE_1)
FILE_2_PATH = path.join(tempdir, FILE_2)