Skip to content

BUG - sammi-cdf==1.0.0 pin masks CoDICE direct-events metadata errors #3379

Description

@leowerneck

Description of the issue

The sammi-cdf==1.0.0 pin in #3334 appears to be hiding a real CoDICE metadata error.

Steps to reproduce the issue

Here's a pyproject.toml:

[project]
name = "sammi-test"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
dependencies = [
    "requests>=2.34.2",
    "sammi-cdf==1.0.0",
]

[project.scripts]
sammi-test = "sammi_test:main"

[build-system]
requires = ["uv_build>=0.12.1,<0.13.0"]
build-backend = "uv_build"

and a test file test.py:

from sammi.validation import CDFValidator

raw = """Global errors:
\tDescriptor global attribute is missing.
The following variables are not ISTP-compliant:
\tflux
\t\tLABLAXIS attribute is missing.
\t\tLABL_PTR_1 should not be present.
"""

print(CDFValidator()._parse_errors(raw))

Here is what I get for this test:

$ uv sync
$ uv run python test.py
[]

Now if I update to "sammi-cdf==1.0.2", I get:

$ uv sync
$ uv run python test.py
['Global errors: Descriptor global attribute is missing.', 'flux:: LABLAXIS attribute is missing.', 'flux:: LABL_PTR_1 should not be present.']

Expected vs Actual behavior

Expected

  • The project should use a SAMMI version that correctly parses the current SPDF validator response.
  • The CoDICE Lo and Hi direct-events products should pass validation because their metadata is compliant.
  • num_events, a one-dimensional spectrogram, should use LABLAXIS rather than LABL_PTR_1.

Actual

  • sammi-cdf==1.0.0 does not recognize the current SPDF response headings and returns an empty error list.
  • Consequently, assert not CDFValidator().validate(file) can pass even when SPDF reported validation errors.
  • SAMMI 1.0.2 and 1.1.0 correctly expose the underlying num_events errors:
LABLAXIS is missing for variable with DISPLAY_TYPE 'spectrogram' and dimension 1.
LABL_PTR_1 is present but unnecessary and will be ignored.

The newer SAMMI versions do not introduce this metadata error; they expose an error that 1.0.0 silently ignores.

Code Snippet (If applicable)

See the minimal example above.

Additional notes, affected areas, and suggested fixes

The affected files are:

  • imap_processing/cdf/config/imap_codice_l2-lo-direct-events_variable_attrs.yaml
  • imap_processing/cdf/config/imap_codice_l2-hi-direct-events_variable_attrs.yaml

Both define num_events with:

DISPLAY_TYPE: spectrogram
LABL_PTR_1: priority_label

The proposed metadata change is to remove LABL_PTR_1: priority_label and add LABLAXIS: Number of Events.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions