Skip to content

Commit 2fe8aea

Browse files
committed
Merge branch 'enzymeml-2' of https://github.com/EnzymeML/enzymeml-specifications into enzymeml-2
2 parents 88ca1d8 + 602b177 commit 2fe8aea

File tree

7 files changed

+164
-164
lines changed

7 files changed

+164
-164
lines changed

docs/model.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ This page provides comprehensive information about the structure and components
7575

7676

7777
## Ontologies
78-
- [schema](https://schema.org/)
7978
- [OBO](http://purl.obolibrary.org/obo/)
79+
- [schema](https://schema.org/)
8080

8181

8282
## Types
@@ -497,12 +497,7 @@ __species_id__* `string`
497497
- The identifier for the described reactant.
498498

499499

500-
__init_conc__* `float`
501-
502-
- Initial concentration of the measurement data. This must be the same as the first data point in the
503-
504-
505-
__conc_unit__* [`UnitDefinition`](#unitdefinition)
500+
__data_unit__* [`UnitDefinition`](#unitdefinition)
506501

507502
- SI unit of the data that was measured.
508503

@@ -517,9 +512,14 @@ __data_type__* `string`
517512
- Type of data that was measured (e.g. concentration)
518513

519514

520-
__prep_conc__ `float`
515+
__prepared__ `float`
516+
517+
- Amount of the reactant before the measurement. This field should be used for specifying the prepared amount of a species in the reaction mix. Not to be confused with
518+
519+
520+
__initial__ `float`
521521

522-
- Concentration of the reactant before the measurement. This field should be used for specifying the prepared concentration of a species in the reaction mix. Not to be confused with init_conc, specifying the concentration at the first data point from the
522+
- Initial amount of the measurement data. This must be the same as the first data point in the
523523

524524

525525
__data__* `list[float]`

python/pyenzyme/dataclass_models.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -721,23 +721,23 @@ class Measurement:
721721
def add_to_species_data(
722722
self,
723723
species_id: str,
724-
init_conc: float,
725-
conc_unit: UnitDefinition,
724+
data_unit: UnitDefinition,
726725
time_unit: UnitDefinition,
727726
data_type: str,
728-
prep_conc: Optional[float] = None,
727+
prepared: Optional[float] = None,
728+
initial: Optional[float] = None,
729729
data: list[float] = [],
730730
time: list[float] = [],
731731
is_simulated: bool = False,
732732
**kwargs,
733733
):
734734
params = {
735735
"species_id": species_id,
736-
"init_conc": init_conc,
737-
"conc_unit": conc_unit,
736+
"data_unit": data_unit,
738737
"time_unit": time_unit,
739738
"data_type": data_type,
740-
"prep_conc": prep_conc,
739+
"prepared": prepared,
740+
"initial": initial,
741741
"data": data,
742742
"time": time,
743743
"is_simulated": is_simulated,
@@ -755,11 +755,13 @@ def add_to_species_data(
755755
@dataclass
756756
class MeasurementData:
757757
species_id: str
758-
init_conc: float
759-
conc_unit: UnitDefinition
758+
data_unit: UnitDefinition
760759
time_unit: UnitDefinition
761760
data_type: str
762-
prep_conc: Optional[float] = field(
761+
prepared: Optional[float] = field(
762+
default=None, metadata=config(exclude=lambda x: x is None)
763+
)
764+
initial: Optional[float] = field(
763765
default=None, metadata=config(exclude=lambda x: x is None)
764766
)
765767
data: List[float] = field(default_factory=list)

python/pyenzyme/pydantic_models.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ class EnzymeMLDocument(BaseModel):
104104
serialization_alias="@context",
105105
default_factory=lambda: {
106106
"enzml": "http://www.enzymeml.org/v2/",
107-
"schema": "https://schema.org/",
108107
"OBO": "http://purl.obolibrary.org/obo/",
108+
"schema": "https://schema.org/",
109109
"name": "schema:title",
110110
"references": {
111111
"@id": "schema:citation",
@@ -505,8 +505,8 @@ class Creator(BaseModel):
505505
serialization_alias="@context",
506506
default_factory=lambda: {
507507
"enzml": "http://www.enzymeml.org/v2/",
508-
"schema": "https://schema.org/",
509508
"OBO": "http://purl.obolibrary.org/obo/",
509+
"schema": "https://schema.org/",
510510
"given_name": "schema:givenName",
511511
"family_name": "schema:familyName",
512512
"mail": "schema:email",
@@ -603,8 +603,8 @@ class Vessel(BaseModel):
603603
serialization_alias="@context",
604604
default_factory=lambda: {
605605
"enzml": "http://www.enzymeml.org/v2/",
606-
"schema": "https://schema.org/",
607606
"OBO": "http://purl.obolibrary.org/obo/",
607+
"schema": "https://schema.org/",
608608
"id": {
609609
"@id": "schema:identifier",
610610
"@type": "@id",
@@ -708,8 +708,8 @@ class Protein(BaseModel):
708708
serialization_alias="@context",
709709
default_factory=lambda: {
710710
"enzml": "http://www.enzymeml.org/v2/",
711-
"schema": "https://schema.org/",
712711
"OBO": "http://purl.obolibrary.org/obo/",
712+
"schema": "https://schema.org/",
713713
"id": {
714714
"@type": "@id",
715715
},
@@ -821,8 +821,8 @@ class Complex(BaseModel):
821821
serialization_alias="@context",
822822
default_factory=lambda: {
823823
"enzml": "http://www.enzymeml.org/v2/",
824-
"schema": "https://schema.org/",
825824
"OBO": "http://purl.obolibrary.org/obo/",
825+
"schema": "https://schema.org/",
826826
"id": {
827827
"@id": "schema:identifier",
828828
"@type": "@id",
@@ -929,8 +929,8 @@ class SmallMolecule(BaseModel):
929929
serialization_alias="@context",
930930
default_factory=lambda: {
931931
"enzml": "http://www.enzymeml.org/v2/",
932-
"schema": "https://schema.org/",
933932
"OBO": "http://purl.obolibrary.org/obo/",
933+
"schema": "https://schema.org/",
934934
"id": {
935935
"@id": "schema:identifier",
936936
"@type": "@id",
@@ -1040,8 +1040,8 @@ class Reaction(BaseModel):
10401040
serialization_alias="@context",
10411041
default_factory=lambda: {
10421042
"enzml": "http://www.enzymeml.org/v2/",
1043-
"schema": "https://schema.org/",
10441043
"OBO": "http://purl.obolibrary.org/obo/",
1044+
"schema": "https://schema.org/",
10451045
"id": {
10461046
"@id": "schema:identifier",
10471047
"@type": "@id",
@@ -1168,8 +1168,8 @@ class ReactionElement(BaseModel):
11681168
serialization_alias="@context",
11691169
default_factory=lambda: {
11701170
"enzml": "http://www.enzymeml.org/v2/",
1171-
"schema": "https://schema.org/",
11721171
"OBO": "http://purl.obolibrary.org/obo/",
1172+
"schema": "https://schema.org/",
11731173
"species_id": {
11741174
"@type": "@id",
11751175
},
@@ -1269,8 +1269,8 @@ class Equation(BaseModel):
12691269
serialization_alias="@context",
12701270
default_factory=lambda: {
12711271
"enzml": "http://www.enzymeml.org/v2/",
1272-
"schema": "https://schema.org/",
12731272
"OBO": "http://purl.obolibrary.org/obo/",
1273+
"schema": "https://schema.org/",
12741274
"species_id": {
12751275
"@type": "@id",
12761276
},
@@ -1430,8 +1430,8 @@ class Parameter(BaseModel):
14301430
serialization_alias="@context",
14311431
default_factory=lambda: {
14321432
"enzml": "http://www.enzymeml.org/v2/",
1433-
"schema": "https://schema.org/",
14341433
"OBO": "http://purl.obolibrary.org/obo/",
1434+
"schema": "https://schema.org/",
14351435
"id": {
14361436
"@id": "schema:identifier",
14371437
"@type": "@id",
@@ -1533,8 +1533,8 @@ class Measurement(BaseModel):
15331533
serialization_alias="@context",
15341534
default_factory=lambda: {
15351535
"enzml": "http://www.enzymeml.org/v2/",
1536-
"schema": "https://schema.org/",
15371536
"OBO": "http://purl.obolibrary.org/obo/",
1537+
"schema": "https://schema.org/",
15381538
"id": {
15391539
"@id": "schema:identifier",
15401540
"@type": "@id",
@@ -1625,23 +1625,23 @@ def add_type_term(
16251625
def add_to_species_data(
16261626
self,
16271627
species_id: str,
1628-
init_conc: float,
1629-
conc_unit: UnitDefinition,
1628+
data_unit: UnitDefinition,
16301629
time_unit: UnitDefinition,
16311630
data_type: str,
1632-
prep_conc: Optional[float] = None,
1631+
prepared: Optional[float] = None,
1632+
initial: Optional[float] = None,
16331633
data: list[float] = [],
16341634
time: list[float] = [],
16351635
is_simulated: bool = False,
16361636
**kwargs,
16371637
):
16381638
params = {
16391639
"species_id": species_id,
1640-
"init_conc": init_conc,
1641-
"conc_unit": conc_unit,
1640+
"data_unit": data_unit,
16421641
"time_unit": time_unit,
16431642
"data_type": data_type,
1644-
"prep_conc": prep_conc,
1643+
"prepared": prepared,
1644+
"initial": initial,
16451645
"data": data,
16461646
"time": time,
16471647
"is_simulated": is_simulated,
@@ -1661,11 +1661,11 @@ class MeasurementData(BaseModel):
16611661
) # type: ignore
16621662

16631663
species_id: str
1664-
init_conc: float
1665-
conc_unit: UnitDefinition
1664+
data_unit: UnitDefinition
16661665
time_unit: UnitDefinition
16671666
data_type: str
1668-
prep_conc: Optional[float] = Field(default=None)
1667+
prepared: Optional[float] = Field(default=None)
1668+
initial: Optional[float] = Field(default=None)
16691669
data: list[float] = Field(default_factory=list)
16701670
time: list[float] = Field(default_factory=list)
16711671
is_simulated: bool = False
@@ -1685,8 +1685,8 @@ class MeasurementData(BaseModel):
16851685
serialization_alias="@context",
16861686
default_factory=lambda: {
16871687
"enzml": "http://www.enzymeml.org/v2/",
1688-
"schema": "https://schema.org/",
16891688
"OBO": "http://purl.obolibrary.org/obo/",
1689+
"schema": "https://schema.org/",
16901690
"species_id": {
16911691
"@type": "@id",
16921692
},
@@ -1786,8 +1786,8 @@ class UnitDefinition(BaseModel):
17861786
serialization_alias="@context",
17871787
default_factory=lambda: {
17881788
"enzml": "http://www.enzymeml.org/v2/",
1789-
"schema": "https://schema.org/",
17901789
"OBO": "http://purl.obolibrary.org/obo/",
1790+
"schema": "https://schema.org/",
17911791
},
17921792
)
17931793

@@ -1916,8 +1916,8 @@ class BaseUnit(BaseModel):
19161916
serialization_alias="@context",
19171917
default_factory=lambda: {
19181918
"enzml": "http://www.enzymeml.org/v2/",
1919-
"schema": "https://schema.org/",
19201919
"OBO": "http://purl.obolibrary.org/obo/",
1920+
"schema": "https://schema.org/",
19211921
},
19221922
)
19231923

@@ -2011,8 +2011,8 @@ class EqVariable(BaseModel):
20112011
serialization_alias="@context",
20122012
default_factory=lambda: {
20132013
"enzml": "http://www.enzymeml.org/v2/",
2014-
"schema": "https://schema.org/",
20152014
"OBO": "http://purl.obolibrary.org/obo/",
2015+
"schema": "https://schema.org/",
20162016
"id": {
20172017
"@type": "@id",
20182018
},
@@ -2110,8 +2110,8 @@ class EqParameter(BaseModel):
21102110
serialization_alias="@context",
21112111
default_factory=lambda: {
21122112
"enzml": "http://www.enzymeml.org/v2/",
2113-
"schema": "https://schema.org/",
21142113
"OBO": "http://purl.obolibrary.org/obo/",
2114+
"schema": "https://schema.org/",
21152115
"id": {
21162116
"@type": "@id",
21172117
},

0 commit comments

Comments
 (0)