-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
6,668 additions
and
6,723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
|
||
name: Build and Test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.9, '3.10'] | ||
python-version: ['3.7', '3.8', 3.9', '3.10'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install python-copasi | ||
pip3 install -e .[test] | ||
- name: Test with pytest | ||
run: | | ||
python3 -m pytest | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=13 --max-line-length=127 --statistics | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip3 install python-copasi | ||
pip3 install -e .[test] | ||
- name: Test with pytest | ||
run: | | ||
python3 -m pytest | ||
- name: Lint with flake8 | ||
run: | | ||
pip install flake8 | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=13 --max-line-length=127 --statistics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
''' | ||
File: __init__.py | ||
Project: core | ||
Author: Jan Range | ||
License: BSD-2 clause | ||
----- | ||
Last Modified: Tuesday June 15th 2021 7:32:36 pm | ||
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>) | ||
----- | ||
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart | ||
''' | ||
|
||
from pyenzyme.enzymeml.core.creator import Creator | ||
from pyenzyme.enzymeml.core.enzymemldocument import EnzymeMLDocument | ||
from pyenzyme.enzymeml.core.protein import Protein | ||
from pyenzyme.enzymeml.core.complex import Complex | ||
from pyenzyme.enzymeml.core.reactant import Reactant | ||
from pyenzyme.enzymeml.core.replicate import Replicate | ||
from pyenzyme.enzymeml.core.unitdef import UnitDef | ||
from pyenzyme.enzymeml.core.vessel import Vessel | ||
from pyenzyme.enzymeml.core.enzymereaction import EnzymeReaction | ||
from pyenzyme.enzymeml.core.enzymemlbase import EnzymeMLBase | ||
from pyenzyme.enzymeml.core.measurementData import MeasurementData | ||
from pyenzyme.enzymeml.core.measurement import Measurement | ||
from pyenzyme.enzymeml.core.ontology import SBOTerm, DataTypes | ||
''' | ||
File: __init__.py | ||
Project: core | ||
Author: Jan Range | ||
License: BSD-2 clause | ||
----- | ||
Last Modified: Tuesday June 15th 2021 7:32:36 pm | ||
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>) | ||
----- | ||
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart | ||
''' | ||
|
||
from pyenzyme.enzymeml.core.creator import Creator | ||
from pyenzyme.enzymeml.core.enzymemldocument import EnzymeMLDocument | ||
from pyenzyme.enzymeml.core.protein import Protein | ||
from pyenzyme.enzymeml.core.complex import Complex | ||
from pyenzyme.enzymeml.core.reactant import Reactant | ||
from pyenzyme.enzymeml.core.replicate import Replicate | ||
from pyenzyme.enzymeml.core.unitdef import UnitDef | ||
from pyenzyme.enzymeml.core.vessel import Vessel | ||
from pyenzyme.enzymeml.core.enzymereaction import EnzymeReaction | ||
from pyenzyme.enzymeml.core.enzymemlbase import EnzymeMLBase | ||
from pyenzyme.enzymeml.core.measurementData import MeasurementData | ||
from pyenzyme.enzymeml.core.measurement import Measurement | ||
from pyenzyme.enzymeml.core.ontology import SBOTerm, DataTypes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,81 @@ | ||
''' | ||
File: creator.py | ||
Project: core | ||
Author: Jan Range | ||
License: BSD-2 clause | ||
----- | ||
Last Modified: Tuesday June 15th 2021 6:28:16 pm | ||
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>) | ||
----- | ||
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart | ||
''' | ||
|
||
from pydantic import Field, validator, ValidationError | ||
from typing import TYPE_CHECKING, Optional | ||
from dataclasses import dataclass | ||
|
||
from pyenzyme.enzymeml.core.enzymemlbase import EnzymeMLBase | ||
from pyenzyme.enzymeml.core.utils import ( | ||
type_checking, | ||
deprecated_getter | ||
) | ||
|
||
if TYPE_CHECKING: # pragma: no cover | ||
static_check_init_args = dataclass | ||
else: | ||
static_check_init_args = type_checking | ||
|
||
|
||
@static_check_init_args | ||
class Creator(EnzymeMLBase): | ||
|
||
given_name: str = Field( | ||
..., | ||
description='Given name of the author or contributor.', | ||
) | ||
|
||
family_name: str = Field( | ||
..., | ||
description='Family name of the author or contributor.', | ||
) | ||
|
||
mail: str = Field( | ||
..., | ||
description='Email address of the author or contributor.', | ||
) | ||
|
||
id: Optional[str] = Field( | ||
None, | ||
description="Unique identifier of the protein.", | ||
regex=r"a[\d]+" | ||
) | ||
|
||
@validator("given_name", "family_name", "mail", pre=True) | ||
def check_empty_strings(cls, value): | ||
if not value: | ||
raise ValueError( | ||
"An empty string has been provided. Please make sure to provide a valid string." | ||
) | ||
|
||
return value | ||
|
||
@validator("mail") | ||
def check_mail_consistency(cls, mail): | ||
if len(mail.split("@")) != 2: | ||
raise ValueError( | ||
f"{mail} is not a valid mail adress." | ||
) | ||
|
||
return mail | ||
|
||
@deprecated_getter("family_name") | ||
def getFname(self) -> str: | ||
return self.family_name | ||
|
||
@deprecated_getter("given_name") | ||
def getGname(self) -> str: | ||
return self.given_name | ||
|
||
@deprecated_getter("mail") | ||
def getMail(self) -> str: | ||
return self.mail | ||
''' | ||
File: creator.py | ||
Project: core | ||
Author: Jan Range | ||
License: BSD-2 clause | ||
----- | ||
Last Modified: Tuesday June 15th 2021 6:28:16 pm | ||
Modified By: Jan Range (<jan.range@simtech.uni-stuttgart.de>) | ||
----- | ||
Copyright (c) 2021 Institute of Biochemistry and Technical Biochemistry Stuttgart | ||
''' | ||
|
||
from pydantic import Field, validator, ValidationError | ||
from typing import TYPE_CHECKING, Optional | ||
from dataclasses import dataclass | ||
|
||
from pyenzyme.enzymeml.core.enzymemlbase import EnzymeMLBase | ||
from pyenzyme.enzymeml.core.utils import ( | ||
type_checking, | ||
deprecated_getter | ||
) | ||
|
||
if TYPE_CHECKING: # pragma: no cover | ||
static_check_init_args = dataclass | ||
else: | ||
static_check_init_args = type_checking | ||
|
||
|
||
@static_check_init_args | ||
class Creator(EnzymeMLBase): | ||
|
||
given_name: str = Field( | ||
..., | ||
description='Given name of the author or contributor.', | ||
) | ||
|
||
family_name: str = Field( | ||
..., | ||
description='Family name of the author or contributor.', | ||
) | ||
|
||
mail: str = Field( | ||
..., | ||
description='Email address of the author or contributor.', | ||
) | ||
|
||
id: Optional[str] = Field( | ||
None, | ||
description="Unique identifier of the protein.", | ||
regex=r"a[\d]+" | ||
) | ||
|
||
@validator("given_name", "family_name", "mail", pre=True) | ||
def check_empty_strings(cls, value): | ||
if not value: | ||
raise ValueError( | ||
"An empty string has been provided. Please make sure to provide a valid string." | ||
) | ||
|
||
return value | ||
|
||
@validator("mail") | ||
def check_mail_consistency(cls, mail): | ||
if len(mail.split("@")) != 2: | ||
raise ValueError( | ||
f"{mail} is not a valid mail adress." | ||
) | ||
|
||
return mail | ||
|
||
@deprecated_getter("family_name") | ||
def getFname(self) -> str: | ||
return self.family_name | ||
|
||
@deprecated_getter("given_name") | ||
def getGname(self) -> str: | ||
return self.given_name | ||
|
||
@deprecated_getter("mail") | ||
def getMail(self) -> str: | ||
return self.mail |
Oops, something went wrong.