Skip to content

Deprecate sample_state_information slot #2354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Apr 15, 2025

Conversation

mslarae13
Copy link
Contributor

discussions in the mass spec material processing squad
this slot shouldn't be on PortionOfSubstance and there's no indication that it's relevant to NMDC

@mslarae13 mslarae13 linked an issue Mar 4, 2025 that may be closed by this pull request
@mslarae13 mslarae13 requested review from turbomam and kheal and removed request for turbomam March 4, 2025 22:03
@mslarae13 mslarae13 self-assigned this Mar 4, 2025
@mslarae13 mslarae13 requested a review from sierra-moxon March 4, 2025 23:44
Copy link

github-actions bot commented Mar 5, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://microbiomedata.github.io/nmdc-schema/pr-preview/pr-2354/

Built to branch gh-pages at 2025-04-15 22:04 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@kheal
Copy link
Contributor

kheal commented Mar 5, 2025

Two requested changes:

  1. Remove the use of this slot on any examples in the src/data/ folder
  2. File a follow up issue to move this element to deprecated.yaml (similar to: Move ProtocolExecution to deprecated.yaml after the next release (11.4.0?) #2337)

Copy link
Member

@turbomam turbomam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise a good PR

@@ -3,7 +3,6 @@
# type: nmdc:QuantityValue
# has_unit: percent
# has_numeric_value: 10
#sample_state_information: liquid
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turbomam what's up with this example? Was it just never finished?

@mslarae13
Copy link
Contributor Author

Reassigning to @eecavanna to plan the migrator.

@mslarae13 mslarae13 assigned eecavanna and unassigned mslarae13 Mar 10, 2025
@eecavanna
Copy link
Collaborator

eecavanna commented Mar 10, 2025

Now that (i.e. as of commit 2c9c250 on this branch) instances of the PortionOfSubstance schema class can no longer have a field named sample_state_information, creating an accompanying migrator will be necessary (in order to "keep data valid across schema versions").

In the schema docs, I can see that the PortionOfSubstance class is in the range of the substances_used slot of the following schema classes:

  • Extraction
  • StorageProcess
  • DissolvingProcess
  • ChemicalConversionProcess
  • MobilePhaseSegment

The migrator will locate each "instance" of each of those classes in the database, check whether it has a substances_used field and—if it does—delete the sample_state_information field from each object in that substances_used field.

@kheal
Copy link
Contributor

kheal commented Mar 10, 2025

@eecavanna note that there will not be instances of MobilePhaseSegment, that class is also in-lined so you'll need to go one class up for that class.

@eecavanna
Copy link
Collaborator

Thanks, @kheal! In search of instances of the MobilePhaseSegment class, I'm planning to have the migrator look at the ordered_mobile_phases fields of instances of the ChromatographyConfiguration class (all of which are represented by documents in the configuration_set collection) and the ChromatographicSeparationProcess class (all of which are represented by documents in the material_processing_set collection).

Copy link
Collaborator

@eecavanna eecavanna Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migrator is not being introduced via this PR. It is only being moved (and its _from_version/_to_version modified).

This migrator was introduced via PR #2413. There, its location was nmdc_schema/migrators/migrator_from_11_5_1_to_11_6_0.py.

In this PR, it is being moved (and its _from_version/_to_version modified) to be a "partial" migrator, since there are now multiple migrators involved between the two schema versions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only migrator being introduced to accompany this schema change.

Copy link
Contributor

@kheal kheal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eecavanna - I reviewed the migrator. The logic, methods, and tests all look great to me. Thank you for the thorough documentation.

@mslarae13
Copy link
Contributor Author

@turbomam @eecavanna @sierra-moxon
Anyone know why these checks are failing now that I've moved the slot to the deprecated.yaml?

@mslarae13 mslarae13 requested review from turbomam and eecavanna April 15, 2025 22:02
@eecavanna
Copy link
Collaborator

eecavanna commented Apr 15, 2025

@mslarae13 the check failed because the computer (one of GitHub's servers) that runs the check failed to install some Python packages. I think it's a transient failure unrelated to the changes on this branch. I've launched a re-run of the check.

@mslarae13 mslarae13 merged commit b4f3734 into main Apr 15, 2025
3 of 4 checks passed
@eecavanna eecavanna deleted the 2353-deprecate-sample_state_information branch April 15, 2025 22:56
@eecavanna eecavanna changed the title mark sample_state_information to be deprecated Deprecate sample_state_information slot Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
4 participants