climate-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huiky...@apache.org
Subject [2/3] climate git commit: minor debugging of load_multiple_files and related updates in configuration files
Date Fri, 09 Sep 2016 16:14:54 GMT
minor debugging of load_multiple_files and related updates in configuration files


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

Branch: refs/heads/master
Commit: 7d005e8acd2e1ebbcdf4f85b904c19c5d91a344c
Parents: fcc4785
Author: huikyole <huikyole@argo.jpl.nasa.gov>
Authored: Wed Sep 7 13:31:04 2016 -0700
Committer: huikyole <huikyole@argo.jpl.nasa.gov>
Committed: Wed Sep 7 13:31:04 2016 -0700

----------------------------------------------------------------------
 .../cordex-arctic_cloud_fraction_bias_to_SRB.yaml             | 2 +-
 .../cordex-arctic_rlds_bias_to_SRB.yaml                       | 2 +-
 .../cordex-arctic_rlus_bias_to_SRB.yaml                       | 2 +-
 .../cordex-arctic_rsds_bias_to_SRB.yaml                       | 2 +-
 .../configuration_files/ESGF_example/ESGF-Example_local.yaml  | 3 ++-
 .../configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml | 2 +-
 RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml  | 2 +-
 RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml  | 2 +-
 .../NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml | 2 +-
 ocw/data_source/local.py                                      | 7 ++++---
 10 files changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml
b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml
index 3549d2b..a33b941 100644
--- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml
+++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_cloud_fraction_bias_to_SRB.yaml
@@ -42,7 +42,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/CORDEX-Arctic_data/srb_rel3.0_shortwave_from_1983_to_2007.nc
           variable_name: cld_frac
           multiplying_factor: 100.0

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml
b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml
index 534b644..70e62d7 100644
--- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml
+++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlds_bias_to_SRB.yaml
@@ -42,7 +42,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/CORDEX-Arctic_data/srb_rel3.0_longwave_from_1983_to_2007.nc
           variable_name: lw_sfc_dn
           multiplying_factor: 1

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml
b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml
index 9c4126f..d1bdba9 100644
--- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml
+++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rlus_bias_to_SRB.yaml
@@ -42,7 +42,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/CORDEX-Arctic_data/srb_rel3.0_longwave_from_1983_to_2007.nc
           variable_name: lw_sfc_up
           multiplying_factor: 1

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml
b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml
index 194894d..28b10aa 100644
--- a/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml
+++ b/RCMES/configuration_files/CORDEX-Arctic_examples/cordex-arctic_rsds_bias_to_SRB.yaml
@@ -42,7 +42,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/CORDEX-Arctic_data/srb_rel3.0_shortwave_from_1983_to_2007.nc
           variable_name: sw_sfc_dn
           multiplying_factor: 1

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml b/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml
index ae1a7a6..11d936e 100644
--- a/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml
+++ b/RCMES/configuration_files/ESGF_example/ESGF-Example_local.yaml
@@ -40,12 +40,13 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: AVISO
+          dataset_name: AVISO
           file_path: ./data/ESGF_data/zos_AVISO_L4_199210-201012.nc
           variable_name: zos
 
     targets:
         - loader_name: local
+          dataset_name: MPI-ESM-LR
           file_path: ./data/ESGF_data/zos_Omon_MPI-ESM-LR_decadal1994_r1i1p1_199501-200412.nc
           variable_name: zos
           GCM_data: True

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml
index a514d6d..2ad8dfa 100644
--- a/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml
+++ b/RCMES/configuration_files/NARCCAP_examples/Fig14_and_Fig15.yaml
@@ -25,7 +25,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc
           variable_name: sw_sfc_dn
 

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml
index 15002b9..0145614 100644
--- a/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml
+++ b/RCMES/configuration_files/NARCCAP_examples/Fig16_summer.yaml
@@ -25,7 +25,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc
           variable_name: sw_sfc_dn
 

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml b/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml
index 2226b9f..ac30f53 100644
--- a/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml
+++ b/RCMES/configuration_files/NARCCAP_examples/Fig16_winter.yaml
@@ -25,7 +25,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: SRB
+          dataset_name: SRB
           file_path: ./data/NARCCAP_data/srb_rel3.0_shortwave_from_1983_to_2007.nc
           variable_name: sw_sfc_dn
 

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml
----------------------------------------------------------------------
diff --git a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml
b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml
index a6436c6..3578d2f 100644
--- a/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml
+++ b/RCMES/configuration_files/NASA_downscaling_project_Part1/dscale_prmo-wus_local.yaml
@@ -25,7 +25,7 @@ regrid:
 datasets:
     reference:
         - loader_name: local
-          name: NLDAS
+          dataset_name: NLDAS
           file_path: ./data/dscale/obs/prmo_lds-lds_1999-2010.nc
           variable_name: pr
 

http://git-wip-us.apache.org/repos/asf/climate/blob/7d005e8a/ocw/data_source/local.py
----------------------------------------------------------------------
diff --git a/ocw/data_source/local.py b/ocw/data_source/local.py
index 50de3a1..e4a24b8 100644
--- a/ocw/data_source/local.py
+++ b/ocw/data_source/local.py
@@ -333,10 +333,11 @@ def load_multiple_files(file_path,
 
     # number of files
     ndata = len(data_filenames)
-    if type(dataset_name) is str:
+    if type(dataset_name) is str and ndata == 1:
         data_name = [dataset_name]
-    elif dataset_name.__name__ == 'list' and len(dataset_name) == ndata:
-        data_name = [name for name in dataset_name]
+    elif type(dataset_name).__name__ == 'list':
+        if len(dataset_name) == ndata:
+            data_name = [name for name in dataset_name]
     else:
         data_name = []
         data_filenames_reversed = []


Mime
View raw message