Skip to content

Commit

Permalink
Merge branch 'enzymeml-2' of https://github.com/EnzymeML/enzymeml-spe…
Browse files Browse the repository at this point in the history
…cifications into enzymeml-2
  • Loading branch information
JR-1991 committed Aug 14, 2024
2 parents 88ca1d8 + 602b177 commit 2fe8aea
Show file tree
Hide file tree
Showing 7 changed files with 164 additions and 164 deletions.
18 changes: 9 additions & 9 deletions docs/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ This page provides comprehensive information about the structure and components


## Ontologies
- [schema](https://schema.org/)
- [OBO](http://purl.obolibrary.org/obo/)
- [schema](https://schema.org/)


## Types
Expand Down Expand Up @@ -497,12 +497,7 @@ __species_id__* `string`
- The identifier for the described reactant.


__init_conc__* `float`

- Initial concentration of the measurement data. This must be the same as the first data point in the


__conc_unit__* [`UnitDefinition`](#unitdefinition)
__data_unit__* [`UnitDefinition`](#unitdefinition)

- SI unit of the data that was measured.

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


__prep_conc__ `float`
__prepared__ `float`

- 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


__initial__ `float`

- 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
- Initial amount of the measurement data. This must be the same as the first data point in the


__data__* `list[float]`
Expand Down
20 changes: 11 additions & 9 deletions python/pyenzyme/dataclass_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,23 +721,23 @@ class Measurement:
def add_to_species_data(
self,
species_id: str,
init_conc: float,
conc_unit: UnitDefinition,
data_unit: UnitDefinition,
time_unit: UnitDefinition,
data_type: str,
prep_conc: Optional[float] = None,
prepared: Optional[float] = None,
initial: Optional[float] = None,
data: list[float] = [],
time: list[float] = [],
is_simulated: bool = False,
**kwargs,
):
params = {
"species_id": species_id,
"init_conc": init_conc,
"conc_unit": conc_unit,
"data_unit": data_unit,
"time_unit": time_unit,
"data_type": data_type,
"prep_conc": prep_conc,
"prepared": prepared,
"initial": initial,
"data": data,
"time": time,
"is_simulated": is_simulated,
Expand All @@ -755,11 +755,13 @@ def add_to_species_data(
@dataclass
class MeasurementData:
species_id: str
init_conc: float
conc_unit: UnitDefinition
data_unit: UnitDefinition
time_unit: UnitDefinition
data_type: str
prep_conc: Optional[float] = field(
prepared: Optional[float] = field(
default=None, metadata=config(exclude=lambda x: x is None)
)
initial: Optional[float] = field(
default=None, metadata=config(exclude=lambda x: x is None)
)
data: List[float] = field(default_factory=list)
Expand Down
50 changes: 25 additions & 25 deletions python/pyenzyme/pydantic_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class EnzymeMLDocument(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"name": "schema:title",
"references": {
"@id": "schema:citation",
Expand Down Expand Up @@ -505,8 +505,8 @@ class Creator(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"given_name": "schema:givenName",
"family_name": "schema:familyName",
"mail": "schema:email",
Expand Down Expand Up @@ -603,8 +603,8 @@ class Vessel(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@id": "schema:identifier",
"@type": "@id",
Expand Down Expand Up @@ -708,8 +708,8 @@ class Protein(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@type": "@id",
},
Expand Down Expand Up @@ -821,8 +821,8 @@ class Complex(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@id": "schema:identifier",
"@type": "@id",
Expand Down Expand Up @@ -929,8 +929,8 @@ class SmallMolecule(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@id": "schema:identifier",
"@type": "@id",
Expand Down Expand Up @@ -1040,8 +1040,8 @@ class Reaction(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@id": "schema:identifier",
"@type": "@id",
Expand Down Expand Up @@ -1168,8 +1168,8 @@ class ReactionElement(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"species_id": {
"@type": "@id",
},
Expand Down Expand Up @@ -1269,8 +1269,8 @@ class Equation(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"species_id": {
"@type": "@id",
},
Expand Down Expand Up @@ -1430,8 +1430,8 @@ class Parameter(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@id": "schema:identifier",
"@type": "@id",
Expand Down Expand Up @@ -1533,8 +1533,8 @@ class Measurement(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@id": "schema:identifier",
"@type": "@id",
Expand Down Expand Up @@ -1625,23 +1625,23 @@ def add_type_term(
def add_to_species_data(
self,
species_id: str,
init_conc: float,
conc_unit: UnitDefinition,
data_unit: UnitDefinition,
time_unit: UnitDefinition,
data_type: str,
prep_conc: Optional[float] = None,
prepared: Optional[float] = None,
initial: Optional[float] = None,
data: list[float] = [],
time: list[float] = [],
is_simulated: bool = False,
**kwargs,
):
params = {
"species_id": species_id,
"init_conc": init_conc,
"conc_unit": conc_unit,
"data_unit": data_unit,
"time_unit": time_unit,
"data_type": data_type,
"prep_conc": prep_conc,
"prepared": prepared,
"initial": initial,
"data": data,
"time": time,
"is_simulated": is_simulated,
Expand All @@ -1661,11 +1661,11 @@ class MeasurementData(BaseModel):
) # type: ignore

species_id: str
init_conc: float
conc_unit: UnitDefinition
data_unit: UnitDefinition
time_unit: UnitDefinition
data_type: str
prep_conc: Optional[float] = Field(default=None)
prepared: Optional[float] = Field(default=None)
initial: Optional[float] = Field(default=None)
data: list[float] = Field(default_factory=list)
time: list[float] = Field(default_factory=list)
is_simulated: bool = False
Expand All @@ -1685,8 +1685,8 @@ class MeasurementData(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"species_id": {
"@type": "@id",
},
Expand Down Expand Up @@ -1786,8 +1786,8 @@ class UnitDefinition(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
},
)

Expand Down Expand Up @@ -1916,8 +1916,8 @@ class BaseUnit(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
},
)

Expand Down Expand Up @@ -2011,8 +2011,8 @@ class EqVariable(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@type": "@id",
},
Expand Down Expand Up @@ -2110,8 +2110,8 @@ class EqParameter(BaseModel):
serialization_alias="@context",
default_factory=lambda: {
"enzml": "http://www.enzymeml.org/v2/",
"schema": "https://schema.org/",
"OBO": "http://purl.obolibrary.org/obo/",
"schema": "https://schema.org/",
"id": {
"@type": "@id",
},
Expand Down
Loading

0 comments on commit 2fe8aea

Please sign in to comment.