Refactor Spectrum schema, and spectrum submit form#396
Conversation
…ove legacy data field and update related properties
…ed on category selection and update chart y-axis configuration accordingly
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #396 +/- ##
==========================================
+ Coverage 62.09% 62.40% +0.30%
==========================================
Files 114 115 +1
Lines 8984 9184 +200
==========================================
+ Hits 5579 5731 +152
- Misses 3405 3453 +48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@claude please review this PR Focus first on the change made to the Spectrum schema.
then focus on the new spectrum form
|
|
Claude finished @tlambert03's task —— View job PR Review: Spectrum Schema RefactorReview Checklist
Schema Changes Review1. Backwards Compatibility ✅Excellent backwards compatibility! The migration and model changes are well-designed: Migration (
|
- Implemented `is_valid_doi` function to check DOI existence via Crossref API. - Integrated DOI validation in `clean_primary_reference` method of SpectrumFormV2. - Updated spectrum form template to display form errors. - Improved CSV parser to validate column count and wavelength data. - Enhanced form controller to manage confirmation checkbox state and restore form state after validation errors. - Added tests for DOI validation and form submission scenarios.
- Added a unique constraint to the Spectrum model to ensure unique (owner, subtype) combinations. - Updated the spectrum form template to improve UI with a smaller font size for the column picker. - Implemented category code retrieval for spectrum owners in the similar spectrum owners AJAX view. - Introduced new tests for peak snapping behavior in the spectrum form, ensuring correct peak selection and normalization. - Enhanced duplicate detection logic for proteins and dyes, disabling existing subtypes in the dropdown. - Improved the column picker JavaScript to adjust preview rows and table height. - Refactored duplicate checker logic to return existing subtypes and handle exact matches more effectively. - Updated form controller to manage owner slug and improve user experience with scale factor selection.
…L for slug-based submission
This PR introduces a new spectrum submission form (v2) and changes how spectrum data is stored in the
database.
Data Storage Changes:
(BinaryField containing float32 values). This replaces the legacy data field (an ArrayField of
[[wavelength, value], ...] pairs).
rather than stored explicitly.
property.
cross-section depending on subtype).
Form Processing (v2):
values).
via get_or_create.
Database Constraints:
subtype).
UX Fixes:
view, and clears the file input so the same file can be re-selected.