Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_all_data_variables(dirname, layers):
""""Put all the relevant data metadata into one big dictionary."""
allvars = [state_variables]
# add others from available_diagnostics.log
fname = os.path.join(dirname, 'available_diagnostics.log')
if os.path.exists(fname):
available_diags = parse_available_diagnostics(fname, layers)
allvars.append(available_diags)
metadata = _concat_dicts(allvars)
# Now add the suffix '-T' to every diagnostic. This is a somewhat hacky
# way to increase the coverage of possible output filenames.
# But it doesn't work in python3!!!
extra_metadata = xr.core.pycompat.OrderedDict()
for name, val in metadata.items():
newname = name + '-T'
extra_metadata[newname] = val
metadata = _concat_dicts([metadata, extra_metadata])
return metadata