Skip to content

fix: support basins without a name - #82

Merged
paulmueller merged 1 commit into
DC-analysis:mainfrom
paulmueller-agent:fix-unnamed-basins
Nov 23, 2026
Merged

paulmueller merged 1 commit into
DC-analysis:mainfrom
paulmueller-agent:fix-unnamed-basins

Conversation

@paulmueller-agent

Copy link
Copy Markdown
Contributor

The "name" of a basin is optional, but a few places required it:

  • HDF5Data basin sorting: since 0.28.3, basins of the same type are sorted by comparing their names directly. A file with two basins of the same type could not be opened if their names were missing (KeyError: 'name') or None (TypeError: '<' not supported between instances of 'str' and 'NoneType'). A single unnamed basin was never compared, so it worked.
  • copy_basins and DCNumJobRunner.task_enforce_basin_strategy: both accessed bn_dict["name"] and bn_dict["description"] directly.

Fix

  • The sort uses a.get("name") or "".
  • copy_basins and the runner use bn_dict.get("name") and bn_dict.get("description"), which pass None to store_basin.

Tests

  • New test_basin_without_name[...] covers two file basins with the names (None, None), ("peter", None), (missing, missing) and ("peter", missing). Each case opens the file, reads "image" from the basin and copies the basins. All 4 cases fail on main and pass here.
  • The read and write tests pass (166), as do all 71 pipeline tests, run one per process locally.
  • flake8 is clean, and ruff shows no new errors.

🤖 Generated with Claude Code

The basin name is optional, but sorting the basins in `HDF5Data`
compared the names directly, so a file with two basins of the same
type without a name (missing or None) could not be opened (`KeyError`
or `TypeError`). `copy_basins` and the job runner also required the
"name" and "description" keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paulmueller
paulmueller merged commit 75b4b5b into DC-analysis:main Nov 23, 2026
6 checks passed
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.15%. Comparing base (ec38e31) to head (d2cc047).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #82   +/-   ##
=======================================
  Coverage   88.15%   88.15%           
=======================================
  Files          63       63           
  Lines        4524     4524           
=======================================
  Hits         3988     3988           
  Misses        536      536           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants