From 732d39a11bf580cc4c8b1d2473f109790c6b38a0 Mon Sep 17 00:00:00 2001 From: "Morten W. Hansen" <109061+mortenwh@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:46:16 +0200 Subject: [PATCH] #347: switch to using variable names as wms layers (#348) --- py_mmd_tools/nc_to_mmd.py | 2 +- tests/test_nc_to_mmd.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py_mmd_tools/nc_to_mmd.py b/py_mmd_tools/nc_to_mmd.py index 549fd1a0..ab79640b 100644 --- a/py_mmd_tools/nc_to_mmd.py +++ b/py_mmd_tools/nc_to_mmd.py @@ -1914,7 +1914,7 @@ def get_data_access_dict( all_netcdf_variables = [] for var in ncin.variables: if "standard_name" in ncin.variables[var].ncattrs(): - all_netcdf_variables.append(ncin.variables[var].standard_name) + all_netcdf_variables.append(ncin.variables[var].name) data_accesses = [ { "type": "OPeNDAP", diff --git a/tests/test_nc_to_mmd.py b/tests/test_nc_to_mmd.py index 664ab912..521ef554 100644 --- a/tests/test_nc_to_mmd.py +++ b/tests/test_nc_to_mmd.py @@ -352,8 +352,8 @@ def test_get_data_access_dict_with_custom_wms(monkeypatch): wms_link='http://test-link') assert data[1]['type'] == 'OGC WMS' assert 'http://test-link' in str(data[1]['resource']) - assert data[1]['wms_layers'] == ['toa_bidirectional_reflectance', - 'toa_bidirectional_reflectance'] + assert data[1]['wms_layers'] == ['M01', + 'M01_copy'] @pytest.mark.py_mmd_tools