Skip to content
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

Make class DataGeneration abstract #74

Merged
merged 5 commits into from
Jan 24, 2024
Merged

Conversation

aclum
Copy link
Collaborator

@aclum aclum commented Jan 19, 2024

Make DataGeneration an abstract class, only subclasses should be used. Remove datgen as a valid typecode. Move omprc as a vaild typecode for subclasses.

This PR is needed so we can migrate slots off of other classes onto either NucleotideSequencing or MassSpectrometry

aclum and others added 2 commits January 19, 2024 08:47
Make class DataGeneration abstract, updated allowable typecodes for subclasses.
@aclum aclum changed the title 1617 data generation typecodes 1617 Make class DataGeneration abstract Jan 19, 2024
@aclum aclum self-assigned this Jan 19, 2024
@brynnz22
Copy link
Collaborator

This looks good to me. The only thing I noticed, I commented each I found above. In the example data files, sometimes the prefix dgms is used and sometimes dgns is used. Based on the changes to the syntax in the schema, I think we just want dgns correct? Otherwise, it looks good to me.

@aclum
Copy link
Collaborator Author

aclum commented Jan 24, 2024

dgms is the typecode for Class MassSpectrometry, dgns is for NucleotideSequencing so we need both typecodes

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.

thanks for the good schema changes and accompanying changes to the valid and invalid example files.

I have some questions bout whether this class really should be abstract or not. But I might just be confused. We should be able to talk through it pretty quickly.

@@ -38,6 +38,6 @@ ordered_mobile_phases:
chromatographic_category: gas_chromatography
Copy link
Member

Choose a reason for hiding this comment

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

these are great invalid file names

Copy link
Member

Choose a reason for hiding this comment

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

how is nmdc-schema supposed to know that the wrong study was associated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't make this file originally, what is meant by that is the value for associated_study is not the correct typecode/Class.

@@ -152,7 +152,7 @@ classes:
slot_usage:
id:
Copy link
Member

Choose a reason for hiding this comment

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

I would like to move away from asserting id patterns in slot_usages because it implies that the range is a string, not a class

Copy link
Member

Choose a reason for hiding this comment

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

I will deal with this in the LinkML repo

has_input:
required: true
pattern: "^nmdc:(bsm|procsm)-[0-9][a-z]{0,6}[0-9]-[A-Za-z0-9]{1,}(\\.[A-Za-z0-9]{1,})*(_[A-Za-z0-9_\\.-]+)?$"
comments:
- pattern should allow typecode for Biosample and ProcessedSample
part_of:
range: DataGeneration
pattern: "^nmdc:datgen-[0-9][a-z]{0,6}[0-9]-[A-Za-z0-9]{1,}(\\.[A-Za-z0-9]{1,})*(_[A-Za-z0-9_\\.-]+)?$" # better applied as a structured_pattern, but even that might get out of sync from the asserted Study structured_pattern
Copy link
Member

Choose a reason for hiding this comment

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

is this the pattern for a DataGeneration's id? if DataGeneration is abstract, then it can't be instantiated. So an id pattern is irrelevant. In that case, we only have to worry about asserting the patterns for the subclasses.

I'm starting to think that we don't really want DataGeneration to be abstract

@turbomam turbomam self-requested a review January 24, 2024 19:30
@aclum aclum merged commit dbe5b23 into main Jan 24, 2024
2 checks passed
@aclum aclum deleted the 1617-DataGeneration-typecodes branch January 24, 2024 23:16
@brynnz22 brynnz22 changed the title 1617 Make class DataGeneration abstract 1617 Make class DataGeneration abstract Mar 27, 2024
@mslarae13
Copy link
Collaborator

Requires migration, but done in parallel with another PR

@brynnz22 brynnz22 changed the title 1617 Make class DataGeneration abstract Make class DataGeneration abstract Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants