Skip to content

Commit e4d1597

Browse files
fixing tests, fixing flake8, fixing mypy
1 parent 724de6b commit e4d1597

File tree

104 files changed

+405
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+405
-212
lines changed

release-notes/0.9.0.md

+4-2

src/sbmlutils/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""sbmlutils - Python utilities for SBML."""
2+
23
from pathlib import Path
34

45
__author__ = "Matthias König"

src/sbmlutils/biomodels.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utilities for downloading biomodel models."""
2+
23
import shutil
34
import tempfile
45
from pathlib import Path

src/sbmlutils/comp/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Package for SBML comp."""
2+
23
from .comp import (
34
# Port,
45
create_ExternalModelDefinition,

src/sbmlutils/comp/flatten.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Helpers for model flattening."""
2+
23
import os
34
import time
45
from pathlib import Path

src/sbmlutils/console.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Rich console for logging."""
2+
23
from rich import pretty
34
from rich.console import Console
45
from rich.theme import Theme

src/sbmlutils/converters/copasi.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Helpers to work with COPASI files."""
2+
23
from pathlib import Path
34

45
import libsbml

src/sbmlutils/converters/mathml.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*, /, +, -
77
and, or, not
88
"""
9+
910
from math import *
1011
from typing import Any, Dict, Optional, Tuple
1112

src/sbmlutils/converters/odefac_example/odefac_example.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example of creating markdown and python code."""
2+
23
from pathlib import Path
34

45
from sbmlutils.console import console

src/sbmlutils/converters/xpp_examples.py

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
pip install libroadrunner
66
```
77
"""
8+
89
from pathlib import Path
910

1011
import roadrunner

src/sbmlutils/cytoscape.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
"""Module for visualiation in Cytoscape."""
2+
23
import os
34
import tempfile
5+
6+
47
os.environ["PY4CYTOSCAPE_DETAIL_LOGGER_DIR"] = str(tempfile.gettempdir())
58

6-
from pathlib import Path
7-
from typing import Any, Union
9+
from pathlib import Path # noqa: E402
10+
from typing import Any, Union # noqa: E402
811

9-
import py4cytoscape as p4c
10-
from requests.exceptions import RequestException
12+
import py4cytoscape as p4c # type: ignore # noqa: E402
13+
from requests.exceptions import RequestException # noqa: E402
1114

12-
from sbmlutils import log
13-
from sbmlutils.console import console
14-
from sbmlutils.parser import antimony_to_sbml
15+
from sbmlutils import log # noqa: E402
16+
from sbmlutils.console import console # noqa: E402
17+
from sbmlutils.parser import antimony_to_sbml # noqa: E402
1518

1619

1720
logger = log.get_logger(__name__)

src/sbmlutils/data/interpolation.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
The functionality is very useful, but only if this can be applied to existing
99
models in a simple manner.
1010
"""
11+
1112
from __future__ import annotations
1213

1314
from pathlib import Path

src/sbmlutils/data/interpolation_example.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example demonstrating the interpolation of data."""
2+
23
import tempfile
34
from pathlib import Path
45

src/sbmlutils/data/interpolation_pancreas.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example demonstrating the interpolation of data."""
2+
23
import tempfile
34
from pathlib import Path
45
from typing import Optional

src/sbmlutils/distrib/distrib_examples.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Code for working with the libsbml distrib package."""
2+
23
import tempfile
34

45
import libsbml

src/sbmlutils/distrib/distrib_packages.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example testing uncertainty with libsbml packages."""
2+
23
import tempfile
34
from pathlib import Path
45

src/sbmlutils/examples/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Examples for model creation."""
2+
23
from pathlib import Path
34
from sbmlutils.examples.dallaman import dallaman
45
from sbmlutils.examples.demo import demo

src/sbmlutils/examples/algebraic_rule.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""AlgebraicRule example."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.resources import EXAMPLES_DIR

src/sbmlutils/examples/annotation.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Model demonstrates how to annotate model objects with SBOTerms and Terms from
44
other ontologies. Annotations use the functionality from `pymetadata`.
55
"""
6+
67
from sbmlutils.examples import templates
78
from sbmlutils.factory import *
89
from sbmlutils.metadata import *

src/sbmlutils/examples/assignment.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""AssignmentRule and InitialAssignment example."""
2+
23
from sbmlutils.console import console
34
from sbmlutils.converters import odefac
45
from sbmlutils.examples import templates

src/sbmlutils/examples/combine_archive/omex_models.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This demonstrates just the very core SBML functionality.
44
"""
5+
56
from pathlib import Path
67
from typing import Optional
78

@@ -69,7 +70,7 @@
6970
for k in range(n_cells - 1):
7071
_m.reactions.append( # type: ignore
7172
Reaction(
72-
sid=f"J{k}", equation=f"S{k} <-> S{k+1}", formula=f"D * (S{k}-S{k+1})"
73+
sid=f"J{k}", equation=f"S{k} <-> S{k + 1}", formula=f"D * (S{k} - S{k + 1})"
7374
),
7475
)
7576

src/sbmlutils/examples/compartment_species_reaction.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Compartment, Species, Reaction example."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata.sbo import *
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Module for DallaMan Meal model."""

src/sbmlutils/examples/demo/demo.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Demo kinetic network."""
2+
23
from pathlib import Path
34

45
from sbmlutils.examples import templates

src/sbmlutils/examples/distrib/distrib_comp.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Distrib and comp example to check flattening."""
2+
23
import shutil
34
from pathlib import Path
45

src/sbmlutils/examples/distrib/distrib_distributions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Distrib example demonstrating distributions."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.validation import ValidationOptions

src/sbmlutils/examples/distrib/distrib_uncertainties.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Uncertainty example."""
2+
23
import libsbml
34

45
from sbmlutils.examples import templates

src/sbmlutils/examples/fbc/fbc_key_value_pair.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""FBC example for KeyValuePairs."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata.sbo import *

src/sbmlutils/examples/fbc/fbc_mass_charge.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""FBC mass and charge example."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata import *

src/sbmlutils/examples/fbc/fbc_userdefinedconstraints.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""FBA example with UserDefinedConstraints."""
2+
23
import numpy as np
34

45
from sbmlutils.examples import templates

src/sbmlutils/examples/fbc/fbc_v2.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""FBA example with exchange reactions."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata import *

src/sbmlutils/examples/fbc/fbc_v3.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""FBA example with exchange reactions."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata.sbo import *

src/sbmlutils/examples/fbc/fbc_version3.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
For latest SBML fbc v3 specification see
44
https://github.com/bgoli/sbml-fbc-spec/blob/main/sf_svn/spec/main.pdf
55
"""
6+
67
from logging import getLogger
78
from pathlib import Path
89

src/sbmlutils/examples/icg/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""ICG examples."""
2+
23
from pathlib import Path
34

45
ICG_PATH = Path(__file__).parent

src/sbmlutils/examples/icg/factory.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""ICG model factory."""
2+
23
from pathlib import Path
34
from typing import Any, Dict
45

src/sbmlutils/examples/icg/model_body.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""PKPD model for whole-body icg metabolism."""
2+
23
import os
34

45
import numpy as np

src/sbmlutils/examples/icg/model_liver.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""ICG liver model."""
2+
23
from pathlib import Path
34

45
from sbmlutils.cytoscape import visualize_sbml

src/sbmlutils/examples/model.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This demonstrates just the very core SBML functionality.
44
"""
5+
56
from pathlib import Path
67

78
import libsbml

src/sbmlutils/examples/model_definitions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Multiple model definitions."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45

src/sbmlutils/examples/multiple_substance_units.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example for substance units."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata.sbo import *

src/sbmlutils/examples/notes.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example model with notes."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45

src/sbmlutils/examples/parameter.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Parameter example."""
2+
23
from sbmlutils.examples import templates
34
from sbmlutils.factory import *
45
from sbmlutils.metadata import *

src/sbmlutils/examples/reaction.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Create reaction example."""
2+
23
import numpy as np
34

45
from sbmlutils.examples import templates

src/sbmlutils/examples/templates.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Template information for the model creation."""
2+
23
from datetime import datetime
34

45
from sbmlutils.factory import Creator

src/sbmlutils/examples/tiny/simulation.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
```
1111
1212
"""
13+
1314
from pathlib import Path
1415

1516
import pandas as pd

src/sbmlutils/examples/tiny/tiny.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tiny model example."""
2+
23
from math import inf
34
from pathlib import Path
45

src/sbmlutils/examples/tutorial/linear_chain.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
`sbmlutils` allows to generate patterns of objects by combining loops in combination
55
with string patterns. In this example we create a kinetic model of a linear chain.
66
"""
7+
78
from sbmlutils.converters import odefac
89
from sbmlutils.cytoscape import visualize_sbml
910
from sbmlutils.examples import templates
@@ -34,15 +35,17 @@
3435
sid=f"S{k + 2}",
3536
initialConcentration=0.0,
3637
compartment="cell",
37-
name=f"Species {k +2}",
38+
name=f"Species {k + 2}",
3839
),
3940
)
4041
model.parameters.append(
41-
Parameter(sid=f"k{k+1}", value=0.1, name=f"rate constant {k+1}"),
42+
Parameter(sid=f"k{k + 1}", value=0.1, name=f"rate constant {k + 1}"),
4243
)
4344
model.reactions.append(
4445
Reaction(
45-
sid=f"J{k+1}", equation=f"S{k+1} -> S{k+2}", formula=f"k{k+1} * S{k+1}"
46+
sid=f"J{k + 1}",
47+
equation=f"S{k + 1} -> S{k + 2}",
48+
formula=f"k{k + 1} * S{k + 1}",
4649
),
4750
)
4851

src/sbmlutils/examples/tutorial/minimal_model.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This demonstrates just the very core SBML functionality.
44
"""
5+
56
from sbmlutils.cytoscape import visualize_sbml
67
from sbmlutils.factory import *
78
from sbmlutils.metadata import *

src/sbmlutils/examples/tutorial/minimal_model_annotations.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Annotate an existing model."""
2+
23
from pathlib import Path
34

45
from sbmlutils.cytoscape import visualize_sbml

src/sbmlutils/examples/tutorial/minimal_model_comp.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example creating composite model."""
2+
23
from pathlib import Path
34

45
from sbmlutils.comp import flatten_sbml
@@ -40,7 +41,7 @@
4041
for k in range(n_cells - 1):
4142
model.reactions.append(
4243
Reaction(
43-
sid=f"J{k}", equation=f"S{k} <-> S{k+1}", formula=f"D * (S{k}-S{k+1})"
44+
sid=f"J{k}", equation=f"S{k} <-> S{k + 1}", formula=f"D * (S{k} - S{k + 1})"
4445
),
4546
)
4647

src/sbmlutils/examples/tutorial/model_composition.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Example for model composition via multiple models."""
2+
23
from pathlib import Path
34

45
from sbmlutils.cytoscape import visualize_sbml

0 commit comments

Comments
 (0)