Add MIAPPE metadata with an editor and legacy migration - #116
Open
jlegrand62 wants to merge 17 commits into
Open
Add MIAPPE metadata with an editor and legacy migration#116jlegrand62 wants to merge 17 commits into
jlegrand62 wants to merge 17 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Notes