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 <markschnit...@hotmail.com>
Authored: Tue Jan 22 09:36:17 2019 +0800
Committer: Mark Schnitzer <markschnit...@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)

Reply via email to