File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,13 +120,12 @@ def _load_cache(file_extension, cache_filepath):
120120 elif file_extension == ".pkl" :
121121 with open (cache_filepath , "rb" ) as f :
122122 data_dict = pickle .load (f ) # some format of 'data' and 'metadata'
123- # TODO Must be a better way to handle these if we are writing the cache.
124123 if isinstance (data_dict , tuple ):
125- # CDIP call returns dictionary in size 1 tuple
126- if len ( data_dict ) == 1 and isinstance (data_dict [0 ], dict ):
124+ # CDIP call returns dictionary in size 2 tuple with the dictionary in first element
125+ if isinstance (data_dict [0 ], dict ):
127126 data_dict = data_dict [0 ]
128- # WPTO hindcast call returns size 2 tuple
129- if len (data_dict ) == 2 :
127+ # WPTO hindcast call returns size 2 tuple with data and metadata as separate elements
128+ elif len (data_dict ) == 2 :
130129 return data_dict [0 ], data_dict [1 ]
131130 data , metadata = data_dict ["data" ], data_dict ["metadata" ]
132131
You can’t perform that action at this time.
0 commit comments