Skip to content

Commit d614016

Browse files
committed
Ran ruff on python
1 parent f15f54e commit d614016

File tree

18 files changed

+61
-70
lines changed

18 files changed

+61
-70
lines changed

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys
1514
import os
15+
import sys
1616

1717
# If extensions (or modules to document with autodoc) are in another directory,
1818
# add these directories to sys.path here. If the directory is relative to the

examples/loadtest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#! /usr/bin/python
22

3-
from lems.model.model import Model
43
import sys
54

5+
from lems.model.model import Model
6+
67
model = Model()
78

89
file_name = "examples/hhcell.xml"

lems/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
:organization: LEMS (https://github.com/organizations/LEMS)
66
"""
77

8-
from lems.model.fundamental import *
9-
from lems.model.structure import *
10-
from lems.model.dynamics import *
11-
from lems.model.simulation import *
128
from lems.model.component import *
9+
from lems.model.dynamics import *
10+
from lems.model.fundamental import *
1311
from lems.model.model import Model
12+
from lems.model.simulation import *
13+
from lems.model.structure import *

lems/base/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from lems import __schema_location__
99

10-
1110
id_counter = 0
1211

1312

lems/dlems/exportdlems.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
:author: Boris Marin
66
"""
77

8-
import sys
9-
import re
108
import json
9+
import re
10+
import sys
1111
from collections import OrderedDict
1212

13+
from lems.model.dynamics import OnCondition, OnStart, StateAssignment
1314
from lems.model.model import Model
14-
from lems.sim.build import order_derived_variables, order_derived_parameters
15-
from lems.model.dynamics import OnStart
16-
from lems.model.dynamics import OnCondition
17-
from lems.model.dynamics import StateAssignment
15+
from lems.sim.build import order_derived_parameters, order_derived_variables
1816

1917
SI_PREF = {"p": 1e-12, "n": 1e-9, "u": 1e-6, "m": 1e-3, "c": 1e-2}
2018

lems/model/component.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
:organization: LEMS (https://github.com/organizations/LEMS)
66
"""
77

8+
from xml.sax.saxutils import quoteattr
9+
810
from lems.base.base import LEMSBase
9-
from lems.base.map import Map
1011
from lems.base.errors import ModelError, ParseError
11-
12+
from lems.base.map import Map
1213
from lems.model.dynamics import Dynamics
13-
from lems.model.structure import Structure
1414
from lems.model.simulation import Simulation
15+
from lems.model.structure import Structure
1516
from lems.parser.expr import ExprParser
16-
from xml.sax.saxutils import quoteattr
1717

1818

1919
class Parameter(LEMSBase):

lems/model/dynamics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"""
77

88
from lems.base.base import LEMSBase
9-
from lems.base.map import Map
109
from lems.base.errors import ModelError, ParseError
10+
from lems.base.map import Map
1111
from lems.parser.expr import ExprParser
1212

1313

lems/model/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def export_to_dom(self):
369369
xmldom = minidom.parseString(xmlstr)
370370
except ExpatError as er:
371371
print("Parsing error:", errors.messages[er.code])
372-
print("at: " + xmlstr[er.offset - 50: er.offset + 50])
372+
print("at: " + xmlstr[er.offset - 50 : er.offset + 50])
373373
print("at: " + ("-" * 50) + "^")
374374
raise
375375
return xmldom

lems/model/structure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"""
77

88
from lems.base.base import LEMSBase
9-
from lems.base.map import Map
109
from lems.base.errors import ModelError
10+
from lems.base.map import Map
1111

1212

1313
class With(LEMSBase):
@@ -273,7 +273,7 @@ def __init__(self, component=None, number=None, component_type=None):
273273
:type: str """
274274

275275
self.number = number
276-
""" Name of the paramter specifying the number of times the component
276+
""" Name of the paramter specifying the number of times the component
277277
reference is to be instantiated.
278278
279279
:type: str"""

lems/parser/LEMS.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ def get_nons_attribute(attribute):
4747
else:
4848
return "%s:%s" % (bits[0], bits[1])
4949

50+
5051
def get_nons_tag_from_node(node):
5152
"""Get tags without namespace prefixes.
5253
@@ -86,6 +87,7 @@ class LEMSXMLNode:
8687
attributes with their corresponding Component definitions (because LEMS
8788
does not know what XML namespaces are).
8889
"""
90+
8991
def __init__(self, pyxmlnode):
9092
self.tag = get_nons_tag_from_node(pyxmlnode)
9193
self.ltag = self.tag.lower()

0 commit comments

Comments
 (0)