1010
1111from mavedb .db .base import Base
1212from mavedb .lib .temp_urns import generate_temp_urn
13- from mavedb .models .collection_association import collection_experiments_association_table
13+ from mavedb .models .collection_association import (
14+ collection_experiments_association_table ,
15+ )
1416from mavedb .models .contributor import Contributor
1517from mavedb .models .controlled_keyword import ControlledKeyword
1618from mavedb .models .doi_identifier import DoiIdentifier
17- from mavedb .models .experiment_controlled_keyword import ExperimentControlledKeywordAssociation
18- from mavedb .models .experiment_publication_identifier import ExperimentPublicationIdentifierAssociation
19+ from mavedb .models .experiment_controlled_keyword import (
20+ ExperimentControlledKeywordAssociation ,
21+ )
22+ from mavedb .models .experiment_publication_identifier import (
23+ ExperimentPublicationIdentifierAssociation ,
24+ )
1925from mavedb .models .experiment_set import ExperimentSet
2026from mavedb .models .legacy_keyword import LegacyKeyword
2127from mavedb .models .publication_identifier import PublicationIdentifier
@@ -78,7 +84,9 @@ class Experiment(Base):
7884 score_sets : Mapped [List ["ScoreSet" ]] = relationship (back_populates = "experiment" , cascade = "all, delete-orphan" )
7985
8086 collections : Mapped [list ["Collection" ]] = relationship (
81- "Collection" , secondary = collection_experiments_association_table , back_populates = "experiments"
87+ "Collection" ,
88+ secondary = collection_experiments_association_table ,
89+ back_populates = "experiments" ,
8290 )
8391 official_collections : Mapped [list ["Collection" ]] = relationship (
8492 "Collection" ,
@@ -98,19 +106,27 @@ class Experiment(Base):
98106 creation_date = Column (Date , nullable = False , default = date .today )
99107 modification_date = Column (Date , nullable = False , default = date .today , onupdate = date .today )
100108 contributors : Mapped [list ["Contributor" ]] = relationship (
101- "Contributor" , secondary = experiments_contributors_association_table , backref = "experiments"
109+ "Contributor" ,
110+ secondary = experiments_contributors_association_table ,
111+ backref = "experiments" ,
102112 )
103113 keyword_objs : Mapped [list ["ExperimentControlledKeywordAssociation" ]] = relationship (
104114 back_populates = "experiment" , cascade = "all, delete-orphan"
105115 )
106116 legacy_keyword_objs : Mapped [list [LegacyKeyword ]] = relationship (
107- "LegacyKeyword" , secondary = experiments_legacy_keywords_association_table , backref = "experiments"
117+ "LegacyKeyword" ,
118+ secondary = experiments_legacy_keywords_association_table ,
119+ backref = "experiments" ,
108120 )
109121 doi_identifiers : Mapped [list [DoiIdentifier ]] = relationship (
110- "DoiIdentifier" , secondary = experiments_doi_identifiers_association_table , backref = "experiments"
122+ "DoiIdentifier" ,
123+ secondary = experiments_doi_identifiers_association_table ,
124+ backref = "experiments" ,
111125 )
112126 publication_identifier_associations : Mapped [list [ExperimentPublicationIdentifierAssociation ]] = relationship (
113- "ExperimentPublicationIdentifierAssociation" , back_populates = "experiment" , cascade = "all, delete-orphan"
127+ "ExperimentPublicationIdentifierAssociation" ,
128+ back_populates = "experiment" ,
129+ cascade = "all, delete-orphan" ,
114130 )
115131 publication_identifiers : AssociationProxy [List [PublicationIdentifier ]] = association_proxy (
116132 "publication_identifier_associations" ,
@@ -120,7 +136,9 @@ class Experiment(Base):
120136
121137 # sra_identifiers = relationship('SraIdentifier', secondary=experiments_sra_identifiers_association_table, backref='experiments')
122138 raw_read_identifiers : Mapped [list [RawReadIdentifier ]] = relationship (
123- "RawReadIdentifier" , secondary = experiments_raw_read_identifiers_association_table , backref = "experiments"
139+ "RawReadIdentifier" ,
140+ secondary = experiments_raw_read_identifiers_association_table ,
141+ backref = "experiments" ,
124142 )
125143
126144 # Unfortunately, we can't use association_proxy here, because in spite of what the documentation seems to imply, it
@@ -170,7 +188,10 @@ async def set_keywords(self, db, keywords: list):
170188 ExperimentControlledKeywordAssociation (
171189 experiment = self ,
172190 controlled_keyword = await self ._find_keyword (
173- db , keyword_obj .keyword .key , keyword_obj .keyword .value , keyword_obj .keyword .vocabulary
191+ db ,
192+ keyword_obj .keyword .key ,
193+ keyword_obj .keyword .value ,
194+ keyword_obj .keyword .vocabulary ,
174195 ),
175196 description = keyword_obj .description ,
176197 )
0 commit comments