Skip to content

Add MIAPPE metadata with an editor and legacy migration - #116

Open
jlegrand62 wants to merge 17 commits into
devfrom
feature/metadata
Open

Add MIAPPE metadata with an editor and legacy migration#116
jlegrand62 wants to merge 17 commits into
devfrom
feature/metadata

Conversation

@jlegrand62

Copy link
Copy Markdown
Member

Summary

Adds MIAPPE-aligned biological metadata support to PlantDB: a write-time schema/validator in the commons layer, CLI migration for legacy scans, and a web UI in the metadata editor to view, edit, and migrate scan metadata.

Changes

  • commons: MIAPPE biological metadata schema (investigation, study, biological material, observed variable) with type-checked write-time validation.
  • CLI: legacy metadata migration and images.json cleanup commands.
  • server: scan info now exposes MIAPPE-aligned biological metadata.
  • client: new metadata editor web UI — load an FSDB, migrate legacy scans (with progress stream), bulk or single-scan edit with per-field MIAPPE tooltips, plus Help/About modals.
  • docs: added developers/miappe_metadata.md (schema mapping & design) and wired it into the mkdocs nav.

Notes

  • Legacy pre-MIAPPE scans are detected and migrated from the UI before editing; the migration is idempotent.
  • Docs reference updated from metadata_miappe_plan.md → miappe_metadata.md.

…alidation

Define the canonical MIAPPE-aligned biological metadata structure for Scan
and validate it at the create and metadata-write boundaries (metadata.py,
core.py). The block is optional; when present, known fields are type-checked.
…CLIs

Add fsdb_migrate_metadata (one-time conversion of legacy Metadata.object to
the MIAPPE tree, idempotent) and fsdb_clean_images_metadata (removes the
now-redundant biological/hardware entries duplicated in images.json). Drop
the legacy images.json fallback read in _load_scan_metadata.
get_scan_info now reads the canonical biologicalMaterial/study structure for
species, plant and environment instead of the legacy Metadata.object block.
Update scan API tests accordingly.
Add a Dash web UI to view, edit and bulk-fill MIAPPE-aligned biological
metadata of local FSDB scans, with per-field specs, flatten/unflatten helpers
and write-back with schema validation. Wire up the metadata_app CLI entry
point.
Drop support for loose scan directories; a database root must now be a proper
ROMI DB. Surface a clearer NotAnFSDBError message from FSDB.connect.
…r UI

Auto-load the DB from --db-path, flag scans still on the legacy object
schema, and add a one-click 'Migrate now' action in the editor. Add
scan_needs_migration/migratable_scans/migrate_scans helpers in db_ops.
diskcache backs Dash background callbacks (used by the metadata editor for
streaming migration progress). Ignore the .dashcache runtime directory.
Wrap list_scans in try/finally so the database connection is released even on
error, matching other call sites.
Cache connected FSDB instances per database path (connect is expensive) with
thread-safe access, close_db to switch databases, and atexit cleanup. Add
migrate_scans_progress to report per-scan progress to a caller.
…gration modal

Restructure the layout (FSDB location + About on top, scan selection beside a
single field-edit form), merging the separate per-scan and bulk-edit flows into
one form driven by the edit-accordion mode. Move migration behind a modal with
a streaming progress bar via a DiskCache background callback, auto-closing on
completion. Close cached DBs when switching databases.
Add Bootstrap icons to card headers, accordion and MIAPPE section titles, move
field tooltips to a question-mark icon on each row, and add app.css to size the
field labels consistently.
@jlegrand62 jlegrand62 self-assigned this Sep 7, 2026
@jlegrand62 jlegrand62 added the enhancement New feature or request label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant