Skip to content

feat(io): unregister and register file formats - #109

Merged
PierreRaybaut merged 1 commit into
developfrom
feature/format-unregistration
Oct 27, 2026
Merged

PierreRaybaut merged 1 commit into
developfrom
feature/format-unregistration

Conversation

@PierreRaybaut

@PierreRaybaut PierreRaybaut commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Adds unregister_format and register_format to the I/O registries (SignalIORegistry, ImageIORegistry).

Format classes are registered when they are defined. A plugin defining file formats (e.g. SPEC and XDI in datalab-synchrotron) had to edit the private _io_format_instances list to remove them when it is unloaded. These methods let it remove its formats and register them again through a public API.

  • unregister_format(format_class) removes the handler of this exact class (handlers of subclasses are formats of their own) and returns whether it was registered.
  • register_format(format_class) registers the class again if it is not registered, and refuses classes of another registry.

Tests: sigima/tests/io/addnewformat_unit_test.py. Release note: 1.4.0.

No computation function changes, so no contract version change.

Used by DataLab-Platform/datalab-synchrotron#3 to remove and register again its SPEC and XDI formats.

Plugins defining file formats can remove them from the I/O registries when
they are unloaded, and register them again, without accessing the registry
internals.

Assisted-by: Claude Opus 5.5
@PierreRaybaut
PierreRaybaut marked this pull request as ready for review October 27, 2026 11:21
@PierreRaybaut
PierreRaybaut merged commit aca59ec into develop Oct 27, 2026
6 checks passed
@ThomasMalletCodra ThomasMalletCodra added this to the v1.4.0 milestone Oct 27, 2026
@PierreRaybaut
PierreRaybaut deleted the feature/format-unregistration branch October 29, 2026 08:24
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