Skip to content

Commit 6229c72

Browse files
committed
fix test to handle energy_per_charge / energy_table name diff
1 parent 0cb13ab commit 6229c72

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

imap_processing/tests/codice/test_codice_l2.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,13 @@ def test_codice_l2_nsw_angular_intensity(mock_get_file_paths, codice_lut_path):
504504
)
505505
l2_val_data = load_cdf(l2_val_data)
506506
for variable in LO_NSW_ANGULAR_VARIABLE_NAMES:
507+
# TODO Ask joey to rename energy_per_charge to energy_table in validation data
508+
if variable in ["energy_per_charge"]:
509+
sdc_var = "energy_table"
510+
else:
511+
sdc_var = variable
507512
np.testing.assert_allclose(
508-
processed_2_ds[variable].values,
513+
processed_2_ds[sdc_var].values,
509514
l2_val_data[variable].values,
510515
rtol=1e-5,
511516
err_msg=f"Mismatch in variable '{variable}'",
@@ -542,9 +547,14 @@ def test_codice_l2_sw_angular_intensity(mock_get_file_paths, codice_lut_path):
542547
)
543548
)
544549
l2_val_data = load_cdf(l2_val_data)
545-
for variable in LO_SW_ANGULAR_VARIABLE_NAMES:
550+
for variable in LO_NSW_ANGULAR_VARIABLE_NAMES:
551+
# TODO Ask joey to rename energy_per_charge to energy_table in validation data
552+
if variable in ["energy_per_charge"]:
553+
sdc_var = "energy_table"
554+
else:
555+
sdc_var = variable
546556
np.testing.assert_allclose(
547-
processed_2_ds[variable].values,
557+
processed_2_ds[sdc_var].values,
548558
l2_val_data[variable].values,
549559
# TODO is 1e-4 ok?
550560
rtol=1e-4,

0 commit comments

Comments
 (0)