fix: improve data handling in initializers and transferer, streamline constructor in radionuclides#480
Merged
fix: improve data handling in initializers and transferer, streamline constructor in radionuclides#480
Conversation
… constructor in radionuclides
Contributor
There was a problem hiding this comment.
Pull request overview
Improves transfer/import robustness by centralizing CSV reading, tightening sample-info filtering, and extending minor-trace chemistry lineage with additional legacy sample point identifiers.
Changes:
- Normalize CSV ingestion and filtering behavior across transferers (including cleanup in radionuclides).
- Add
SamplePtID/SamplePointIDlineage fields to MinorTraceChemistry (model, transfer logic, tests, and migration). - Prevent duplicate term-category associations during lexicon initialization.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| transfers/transferer.py | Switches to internal CSV reader and improves orphan-record logging/details. |
| transfers/radionuclides.py | Removes custom dataframe-loading path and streamlines constructor. |
| transfers/minor_trace_chemistry_transfer.py | Persists additional sample-point lineage fields and upserts them. |
| db/nma_legacy.py | Adds new mapped columns for sample-point lineage on NMA_MinorTraceChemistry. |
| alembic/versions/e71807682f57_add_sample_point_fields_to_minor_trace.py | Introduces schema changes to store new lineage fields. |
| core/initializers.py | Avoids inserting duplicate lexicon links within a single init run. |
| tests/test_nma_chemistry_lineage.py | Adjusts expectations and persistence tests for new columns. |
| tests/test_minor_trace_chemistry_transfer.py | Ensures transfer dict includes new lineage keys. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bab253f4f1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
alembic/versions/e71807682f57_add_sample_point_fields_to_minor_trace.py
Outdated
Show resolved
Hide resolved
…ters_transfer and minor_trace_chemistry_transfer
…_trace.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
alembic/versions/e71807682f57_add_sample_point_fields_to_minor_trace.py
Outdated
Show resolved
Hide resolved
…_trace.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…TraceChemistryTransferer ```
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.
Why
This PR addresses the following problem / context:
How
Implementation summary - the following was changed / added / removed:
Notes
Any special considerations, workarounds, or follow-up work to note?