Skip to content

Commit 85c29e4

Browse files
committed
Add 'fit' parameter to Parameter model and context
Introduces an optional 'fit' boolean to the Parameter model and related method, indicating if a parameter should be varied during optimization. Also reorders the '@context' dictionary entries for consistency across multiple classes.
1 parent 0bfa14d commit 85c29e4

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

pyenzyme/versions/v2.py

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ class EnzymeMLDocument(BaseModel):
201201
serialization_alias="@context",
202202
default_factory=lambda: {
203203
"enzml": "http://www.enzymeml.org/v2/",
204-
"schema": "https://schema.org/",
205204
"OBO": "http://purl.obolibrary.org/obo/",
205+
"schema": "https://schema.org/",
206206
"name": "schema:title",
207207
"created": "schema:dateCreated",
208208
"modified": "schema:dateModified",
@@ -603,6 +603,7 @@ def add_to_parameters(
603603
initial_value: Optional[float] = None,
604604
upper_bound: Optional[float] = None,
605605
lower_bound: Optional[float] = None,
606+
fit: Optional[bool] = True,
606607
stderr: Optional[float] = None,
607608
constant: Optional[bool] = True,
608609
**kwargs,
@@ -616,6 +617,7 @@ def add_to_parameters(
616617
"initial_value": initial_value,
617618
"upper_bound": upper_bound,
618619
"lower_bound": lower_bound,
620+
"fit": fit,
619621
"stderr": stderr,
620622
"constant": constant,
621623
}
@@ -659,8 +661,8 @@ class Creator(BaseModel):
659661
serialization_alias="@context",
660662
default_factory=lambda: {
661663
"enzml": "http://www.enzymeml.org/v2/",
662-
"schema": "https://schema.org/",
663664
"OBO": "http://purl.obolibrary.org/obo/",
665+
"schema": "https://schema.org/",
664666
"given_name": "schema:givenName",
665667
"family_name": "schema:familyName",
666668
"mail": "schema:email",
@@ -773,8 +775,8 @@ class Vessel(BaseModel):
773775
serialization_alias="@context",
774776
default_factory=lambda: {
775777
"enzml": "http://www.enzymeml.org/v2/",
776-
"schema": "https://schema.org/",
777778
"OBO": "http://purl.obolibrary.org/obo/",
779+
"schema": "https://schema.org/",
778780
"id": {
779781
"@id": "schema:identifier",
780782
"@type": "@id",
@@ -911,8 +913,8 @@ class Protein(BaseModel):
911913
serialization_alias="@context",
912914
default_factory=lambda: {
913915
"enzml": "http://www.enzymeml.org/v2/",
914-
"schema": "https://schema.org/",
915916
"OBO": "http://purl.obolibrary.org/obo/",
917+
"schema": "https://schema.org/",
916918
"id": {
917919
"@id": "schema:identifier",
918920
"@type": "@id",
@@ -1044,8 +1046,8 @@ class Complex(BaseModel):
10441046
serialization_alias="@context",
10451047
default_factory=lambda: {
10461048
"enzml": "http://www.enzymeml.org/v2/",
1047-
"schema": "https://schema.org/",
10481049
"OBO": "http://purl.obolibrary.org/obo/",
1050+
"schema": "https://schema.org/",
10491051
"id": {
10501052
"@id": "schema:identifier",
10511053
"@type": "@id",
@@ -1195,8 +1197,8 @@ class SmallMolecule(BaseModel):
11951197
serialization_alias="@context",
11961198
default_factory=lambda: {
11971199
"enzml": "http://www.enzymeml.org/v2/",
1198-
"schema": "https://schema.org/",
11991200
"OBO": "http://purl.obolibrary.org/obo/",
1201+
"schema": "https://schema.org/",
12001202
"id": {
12011203
"@id": "schema:identifier",
12021204
"@type": "@id",
@@ -1330,8 +1332,8 @@ class Reaction(BaseModel):
13301332
serialization_alias="@context",
13311333
default_factory=lambda: {
13321334
"enzml": "http://www.enzymeml.org/v2/",
1333-
"schema": "https://schema.org/",
13341335
"OBO": "http://purl.obolibrary.org/obo/",
1336+
"schema": "https://schema.org/",
13351337
"id": {
13361338
"@id": "schema:identifier",
13371339
"@type": "@id",
@@ -1517,8 +1519,8 @@ class ReactionElement(BaseModel):
15171519
serialization_alias="@context",
15181520
default_factory=lambda: {
15191521
"enzml": "http://www.enzymeml.org/v2/",
1520-
"schema": "https://schema.org/",
15211522
"OBO": "http://purl.obolibrary.org/obo/",
1523+
"schema": "https://schema.org/",
15221524
"species_id": {
15231525
"@id": "schema:identifier",
15241526
"@type": "@id",
@@ -1622,8 +1624,8 @@ class ModifierElement(BaseModel):
16221624
serialization_alias="@context",
16231625
default_factory=lambda: {
16241626
"enzml": "http://www.enzymeml.org/v2/",
1625-
"schema": "https://schema.org/",
16261627
"OBO": "http://purl.obolibrary.org/obo/",
1628+
"schema": "https://schema.org/",
16271629
"species_id": {
16281630
"@id": "schema:identifier",
16291631
"@type": "@id",
@@ -1738,8 +1740,8 @@ class Equation(BaseModel):
17381740
serialization_alias="@context",
17391741
default_factory=lambda: {
17401742
"enzml": "http://www.enzymeml.org/v2/",
1741-
"schema": "https://schema.org/",
17421743
"OBO": "http://purl.obolibrary.org/obo/",
1744+
"schema": "https://schema.org/",
17431745
"species_id": {
17441746
"@id": "schema:identifier",
17451747
"@type": "@id",
@@ -1874,8 +1876,8 @@ class Variable(BaseModel):
18741876
serialization_alias="@context",
18751877
default_factory=lambda: {
18761878
"enzml": "http://www.enzymeml.org/v2/",
1877-
"schema": "https://schema.org/",
18781879
"OBO": "http://purl.obolibrary.org/obo/",
1880+
"schema": "https://schema.org/",
18791881
"id": {
18801882
"@id": "schema:identifier",
18811883
"@type": "@id",
@@ -1989,6 +1991,11 @@ class Parameter(BaseModel):
19891991
description="""Lower bound for the parameter value that was used
19901992
for the parameter estimation""",
19911993
)
1994+
fit: Optional[bool] = Field(
1995+
default=True,
1996+
description="""Whether this parameter should be varied or not in
1997+
the context of an optimization.""",
1998+
)
19921999
stderr: Optional[float] = Field(
19932000
default=None,
19942001
description="""Standard error of the estimated parameter.""",
@@ -2014,8 +2021,8 @@ class Parameter(BaseModel):
20142021
serialization_alias="@context",
20152022
default_factory=lambda: {
20162023
"enzml": "http://www.enzymeml.org/v2/",
2017-
"schema": "https://schema.org/",
20182024
"OBO": "http://purl.obolibrary.org/obo/",
2025+
"schema": "https://schema.org/",
20192026
"id": {
20202027
"@id": "schema:identifier",
20212028
"@type": "@id",
@@ -2141,8 +2148,8 @@ class Measurement(BaseModel):
21412148
serialization_alias="@context",
21422149
default_factory=lambda: {
21432150
"enzml": "http://www.enzymeml.org/v2/",
2144-
"schema": "https://schema.org/",
21452151
"OBO": "http://purl.obolibrary.org/obo/",
2152+
"schema": "https://schema.org/",
21462153
"id": {
21472154
"@id": "schema:identifier",
21482155
"@type": "@id",
@@ -2330,8 +2337,8 @@ class MeasurementData(BaseModel):
23302337
serialization_alias="@context",
23312338
default_factory=lambda: {
23322339
"enzml": "http://www.enzymeml.org/v2/",
2333-
"schema": "https://schema.org/",
23342340
"OBO": "http://purl.obolibrary.org/obo/",
2341+
"schema": "https://schema.org/",
23352342
"species_id": {
23362343
"@type": "@id",
23372344
},

0 commit comments

Comments
 (0)