Skip to content

Commit

Permalink
fixing style #22
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Feb 24, 2024
1 parent aba3243 commit 5e15cb6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
7 changes: 2 additions & 5 deletions tools/devel/orphaned_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later

# @file orhaphaned_tests.py
# @file orphaned_tests.py
# @author Jakob Erdmann
# @date 2024-02-21

Expand All @@ -21,8 +21,6 @@
from __future__ import print_function
import sys
import os
from collections import defaultdict
import glob
if 'SUMO_HOME' in os.environ:
sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools'))
import sumolib # noqa
Expand All @@ -34,8 +32,7 @@ def get_options():
help="root directory of tests to analyze")
op.add_argument("--fix", action="store_true", default=False,
help="automatically append missing tests to test suites")
options = op.parse_args()
return options
return op.parse_args()


options = get_options()
Expand Down
6 changes: 4 additions & 2 deletions tools/devel/scalability.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ def main():
tc = [2**p for p in range(20) if 2**p <= options.threads]
results = []
for t in tc:
timer = timeit.Timer('subprocess.call(["%s", "-n", "net.net.xml", "-r", "%s", "--threads", "%s", "--no-step-log"])' %
(sumolib.checkBinary("sumo").replace("\\", "\\\\"), rout.name, t), setup='import subprocess')
timer = timeit.Timer('subprocess.call(["%s", "-n", "net.net.xml", "-r", "%s", '
'"--threads", "%s", "--no-step-log"])' %
(sumolib.checkBinary("sumo").replace("\\", "\\\\"), rout.name, t),
setup='import subprocess')
times = timer.repeat(options.runs, 1)
if options.verbose:
print(t, times)
Expand Down
3 changes: 2 additions & 1 deletion tools/sumolib/net/generator/corridor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from __future__ import absolute_import
# relative imports don't work if a file is used as a library and executable
# (https://peps.python.org/pep-0366/#rationale-for-change)
import os, sys
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import network # noqa

Expand Down
3 changes: 2 additions & 1 deletion tools/sumolib/net/generator/cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from __future__ import absolute_import
# relative imports don't work if a file is used as a library and executable
# (https://peps.python.org/pep-0366/#rationale-for-change)
import os, sys
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import network # noqa

Expand Down
3 changes: 2 additions & 1 deletion tools/sumolib/net/generator/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from __future__ import absolute_import
# relative imports don't work if a file is used as a library and executable
# (https://peps.python.org/pep-0366/#rationale-for-change)
import os, sys
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import network # noqa

Expand Down
3 changes: 2 additions & 1 deletion tools/sumolib/net/generator/straight.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from __future__ import absolute_import
# relative imports don't work if a file is used as a library and executable
# (https://peps.python.org/pep-0366/#rationale-for-change)
import os, sys
import os
import sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import network # noqa

Expand Down
4 changes: 2 additions & 2 deletions tools/sumolib/net/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ def __repr__(self):

def getMaxTLLinkIndex(self):
idx = []
if self.getType()=='traffic_light':
if self.getType() == 'traffic_light':
for conn in self.getConnections():
idx.append(conn.getTLLinkIndex())
return(max(idx))
return (max(idx))
else:
return None

0 comments on commit 5e15cb6

Please sign in to comment.