From d8c4712b3780b22aab1281328b95108da2e1bd68 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sun, 27 Aug 2023 16:17:42 +0200 Subject: [PATCH] isort --- .pre-commit-config.yaml | 6 ++++++ sbmlmath/__init__.py | 5 ++--- sbmlmath/cfunction.py | 8 ++++++-- sbmlmath/mathml_parser.py | 5 +++-- sbmlmath/mathml_printer.py | 3 +-- tests/test_parser.py | 1 + tests/test_printer.py | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6eb5a75..c30a89d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,12 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: +- repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort + name: isort (python) + args: ["--profile", "black", "--filter-files"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: diff --git a/sbmlmath/__init__.py b/sbmlmath/__init__.py index 88e6462..b3dbaa3 100644 --- a/sbmlmath/__init__.py +++ b/sbmlmath/__init__.py @@ -3,12 +3,11 @@ import libsbml import sympy as sp +from .cfunction import * +from .csymbol import * from .mathml_parser import SBMLMathMLParser from .mathml_printer import SBMLMathMLPrinter from .species_symbol import SpeciesSymbol -from .csymbol import * -from .cfunction import * - __all__ = [ "SBMLMathMLParser", diff --git a/sbmlmath/cfunction.py b/sbmlmath/cfunction.py index b24fc23..57bc714 100644 --- a/sbmlmath/cfunction.py +++ b/sbmlmath/cfunction.py @@ -48,5 +48,9 @@ def __new__( # SBML-defined functions -delay = CFunction("delay", definition_url="http://www.sbml.org/sbml/symbols/delay") -rate_of = CFunction("rateOf", definition_url="http://www.sbml.org/sbml/symbols/rateOf") +delay = CFunction( + "delay", definition_url="http://www.sbml.org/sbml/symbols/delay" +) +rate_of = CFunction( + "rateOf", definition_url="http://www.sbml.org/sbml/symbols/rateOf" +) diff --git a/sbmlmath/mathml_parser.py b/sbmlmath/mathml_parser.py index 97e49f6..4958559 100644 --- a/sbmlmath/mathml_parser.py +++ b/sbmlmath/mathml_parser.py @@ -4,14 +4,15 @@ from functools import reduce from io import BytesIO from typing import Union + import sympy as sp from lxml import etree from pint import UnitRegistry from sympy.logic.boolalg import Boolean, BooleanFalse, BooleanTrue -from .species_symbol import SpeciesSymbol -from .csymbol import CSymbol from .cfunction import CFunction +from .csymbol import CSymbol +from .species_symbol import SpeciesSymbol __all__ = ["SBMLMathMLParser"] diff --git a/sbmlmath/mathml_printer.py b/sbmlmath/mathml_printer.py index ba43e61..6ab2fca 100644 --- a/sbmlmath/mathml_printer.py +++ b/sbmlmath/mathml_printer.py @@ -4,9 +4,8 @@ import sympy as sp from sympy.printing.mathml import MathMLContentPrinter -from .species_symbol import SpeciesSymbol from .csymbol import CSymbol - +from .species_symbol import SpeciesSymbol __all__ = ["SBMLMathMLPrinter"] diff --git a/tests/test_parser.py b/tests/test_parser.py index c67efaa..613682e 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -1,6 +1,7 @@ import libsbml import pytest import sympy as sp + from sbmlmath import * diff --git a/tests/test_printer.py b/tests/test_printer.py index 50caf56..26d6433 100644 --- a/tests/test_printer.py +++ b/tests/test_printer.py @@ -1,4 +1,4 @@ -from sbmlmath import SpeciesSymbol, SBMLMathMLPrinter +from sbmlmath import SBMLMathMLPrinter, SpeciesSymbol def test_species_symbol_repr_type():