Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Jun 10, 2024
1 parent 4de5a32 commit 51168f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions matsim/calibration/run_create_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import argparse
import traceback

METADATA = "create-csv", "Create plots and csv from calibration study."

Expand Down
9 changes: 6 additions & 3 deletions matsim/calibration/run_simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def run(jar: Union[str, os.PathLike],
if not os.access(config, os.R_OK):
raise ValueError("Can not access config File: %s" % config)

if worker_id >= workers:
raise ValueError("Worker ID must be smaller than number of workers (starts at 0).")

if not os.path.exists("eval-runs"):
makedirs("eval-runs")

Expand All @@ -63,11 +66,11 @@ def run(jar: Union[str, os.PathLike],
print("Run %s already exists, skipping." % run_dir)
continue

run_args = args(completed) if callable(args) else args
run_args = args(i) if callable(args) else args

# Same custom cli interface as calibration
# Similar custom cli interface as calibration
if custom_cli:
cmd = custom_cli(jvm_args, jar, config, params_path, run_dir, trial.number, run_args)
cmd = custom_cli(jvm_args, jar, config, run_dir, i, seed + i, run_args)
else:
cmd = "java %s -jar %s run --config %s --output %s --runId %03d --config:global.randomSeed=%d %s" \
% (jvm_args, jar, config, run_dir, i, seed + i, run_args)
Expand Down

0 comments on commit 51168f4

Please sign in to comment.