From 33cdbc4b0e45f1ed4cb321d5e9d391b26fd287b2 Mon Sep 17 00:00:00 2001 From: Leo Werneck Date: Wed, 21 Oct 2026 09:52:17 -0400 Subject: [PATCH 1/2] Bumped cdflib to 1.3.15 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 493953c9c7..a30b315d75 100644 --- a/poetry.lock +++ b/poetry.lock @@ -227,14 +227,14 @@ lxml = ["lxml"] [[package]] name = "cdflib" -version = "1.3.12" +version = "1.3.15" description = "A python CDF reader toolkit" optional = false python-versions = ">=3.9" groups = ["main"] files = [ - {file = "cdflib-1.3.12-py3-none-any.whl", hash = "sha256:ef3df6e7ea918223059c7c8384802d52d9a1f655d5db677b7b8d29fd9f3d2381"}, - {file = "cdflib-1.3.12.tar.gz", hash = "sha256:b74fbbeac4c26e7a32a4aff678c7ae249682d77898c9674654e1a038c8c2624c"}, + {file = "cdflib-1.3.15-py3-none-any.whl", hash = "sha256:90f9b1f86bfdfc8637a8cc0f14f5545a7d83a3722579c8ba78a2a71b0d046137"}, + {file = "cdflib-1.3.15.tar.gz", hash = "sha256:cdb71c0b280988a69c18b369eb3bd4bd9738d153acd4ed85908cbde5fc511d5f"}, ] [package.dependencies] @@ -3162,4 +3162,4 @@ tools = ["openpyxl", "pandas"] [metadata] lock-version = "2.1" python-versions = ">=3.10,<3.15" -content-hash = "f34f41059bd79accf06652aa077c863ccf9a92543282abad9fc5252c9ee5b7fb" +content-hash = "84b71ee1b16cc325cf0270ecce93747457ddafe0a96aa7aaa57941fc5bc95dab" diff --git a/pyproject.toml b/pyproject.toml index d2b784a388..72728097f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ classifiers = [ ] dependencies = [ "astropy-healpix>=1.0", - "cdflib>=1.3.11", + "cdflib>=1.3.15", "imap-data-access>=1.3.0", "space_packet_parser>=6.0.0", "spiceypy>=6.0.0", From f245513bfe785ea5cd04f53a33b269d0509ccd71 Mon Sep 17 00:00:00 2001 From: Leo Werneck Date: Wed, 21 Oct 2026 09:59:05 -0400 Subject: [PATCH 2/2] imap_processing/tests/cdf/test_utils.py: added regression test for CDF attributes --- imap_processing/tests/cdf/test_utils.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/imap_processing/tests/cdf/test_utils.py b/imap_processing/tests/cdf/test_utils.py index 6482b89e26..1e2f15e5ba 100644 --- a/imap_processing/tests/cdf/test_utils.py +++ b/imap_processing/tests/cdf/test_utils.py @@ -2,6 +2,7 @@ from unittest import mock +import cdflib import imap_data_access import numpy as np import pandas as pd @@ -141,6 +142,23 @@ def test_write_cdf_extra_cdf_kwargs(test_dataset): assert xarray_to_cdf.call_args.kwargs["compression"] == 9 +def test_write_cdf_l2_epoch_attribute_types(test_dataset): + """Test epoch attribute is TT2000, while epoch_delta attributes stay INT8.""" + test_dataset.attrs["Logical_source"] = "imap_swe_l2_sci" + swe_attrs = ImapCdfAttributes() + test_dataset["epoch_delta"] = ( + "epoch", + np.ones(3, dtype=np.int64), + swe_attrs.get_variable_attributes("epoch_delta", check_schema=False), + ) + file_path = write_cdf(test_dataset, terminate_on_warning=False) + + with cdflib.CDF(file_path) as cdf: + for att in ("FILLVAL", "VALIDMIN", "VALIDMAX"): + assert cdf.attget(att, "epoch").Data_Type == "CDF_TIME_TT2000" + assert cdf.attget(att, "epoch_delta").Data_Type == "CDF_INT8" + + def test_write_cdf_converts_extension_array(test_dataset): """Pass NumPy string data to cdflib without changing the input dataset.""" test_dataset["labels"] = (