Skip to content

Simplify Pyramidal5DImageData open API#76

Draft
stefanhahmann wants to merge 6 commits into
mainfrom
simplify-open-api
Draft

Simplify Pyramidal5DImageData open API#76
stefanhahmann wants to merge 6 commits into
mainfrom
simplify-open-api

Conversation

@stefanhahmann
Copy link
Copy Markdown
Collaborator

@stefanhahmann stefanhahmann commented May 13, 2026

Summary

  • Replace (Context, URI, Integer preferredWidth) factory-method signatures on Pyramidal5DImageData with (Context, URI) (no-settings) and (Context, URI, ZarrOpeningSettings) overloads, removing the raw Integer preferredWidth parameter from the public API
  • Add ZarrOpeningSettings.defaultSettings() factory method and effectivePreferredWidth() helper, which encapsulate the "null width for highest resolution" logic that was previously scattered across callers
  • Add BackendMismatchException (unchecked) thrown when openWithN5/openWithZarrJava receive settings that specify the wrong backend, making misuse of the specific-backend methods fail fast with a clear message
  • Simplify ZarrOpenActions.openMultiScaleImage() to delegate entirely to Pyramidal5DImageData.open(), removing the inline switch on backend
  • Remove the PrefService look-up from Pyramidal5DImageData.open(); settings are now passed in by the caller rather than read from persisted preferences inside the factory method
  • Make ZarrOpenActions constructors package-private (they were only ever called from within the package)

Test plan

  • mvn test passes (all existing tests updated to new API, new BackendMismatchException tests added)
  • testOpenWithN5ThrowsOnZarrJavaBackendSettingsopenWithN5 rejects ZARR_JAVA settings
  • testOpenWithZarrJavaThrowsOnN5BackendSettingsopenWithZarrJava rejects N5 settings
  • testOpenWithDefaultSettingsUsesN5Backend – no-arg open() uses N5 as default
  • testOpenWithPreferredWidthN5 / testOpenWithPreferredWidthZarrJava – resolution selection still works via settings

@stefanhahmann stefanhahmann self-assigned this May 13, 2026
stefanhahmann and others added 6 commits May 18, 2026 13:54
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…, ZarrOpeningSettings])

Adds BackendMismatchException for calls where settings specify a
conflicting backend.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Data.open()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…backend validation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stefanhahmann stefanhahmann force-pushed the simplify-open-api branch 2 times, most recently from 37bb698 to b47ba14 Compare May 18, 2026 11:54
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant