• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FAIRmat-NFDI / pynxtools / 26625826607

29 May 2026 08:04AM UTC coverage: 83.891% (+1.3%) from 82.604%
26625826607

push

github

web-flow
Pure `NXdata` detection logic (#792)

* extract pure NXdata detection into nexus/nxdata.py

Move pure NXdata detection logic out of annotator/nxdata.py into a new
nexus/nxdata.py module with no logging dependency, so both the annotator
and the validator can reuse it.

- nexus/nxdata.py: NXdataInfo dataclass; classify_field (v3→v2→v1
  attribute detection); find_default_nxentry/find_default_nxdata
  (default-chain walk); inspect_nxdata (returns structured NXdataInfo
  implementing all three plottable conventions); axis/signal helpers
  re-exported for backward compat.

- annotator/nxdata.py: chk_nxdata_axis / chk_nxdata_axis_v2 become
  thin logging wrappers around classify_field; pure helpers removed
  (re-exported from nexus/nxdata.py).

- nexus/nexus.py: get_default_plottable now delegates to
  find_default_nxdata + inspect_nxdata; removes the ad-hoc loop.

- validation.py: _handle_nxdata uses inspect_nxdata for structured
  signal/axes/aux_signals/AXISNAME_indices validation; v1 heuristic
  excluded (guard on @signal attr preserved to avoid false positives).

- tests/nexus/test_nxdata.py: 24 unit tests covering classify_field,
  find_default_nxdata, find_default_nxentry, and inspect_nxdata across
  all three detection conventions.

* use NXdata cache in annotator, move default plottable functionality

* remove and deprecate old unused functionality

* rebase issues

* remove unneeded backwards compatibility

* minor fix for validation output after PR review

---------

Co-authored-by: lukaspie <lukaspie@github.com>

450 of 479 new or added lines in 4 files covered. (93.95%)

2 existing lines in 1 file now uncovered.

7452 of 8883 relevant lines covered (83.89%)

0.84 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.24
/src/pynxtools/annotator/annotator.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc