Skip to content

Commit

Permalink
seems to work
Browse files Browse the repository at this point in the history
  • Loading branch information
fxjung committed Aug 1, 2024
1 parent 5aa2194 commit 901b907
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/ridepy/extras/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,13 @@ def read_events_json(jsonl_path: Path) -> list[dict]:
return list(map(json.loads, f.readlines()))


def create_info_json(info: dict, *, sort=True) -> str:
def create_info_json(info: dict) -> str:
"""
Convert a dictionary containing simulation info to pretty JSON.
Parameters
----------
info
dictionary containing the info to save
sort
if sort is True, sort the dict recursively to ensure consistent order.
"""
if sort:
info = sort_params(info)
return json.dumps(info, indent=4)
5 changes: 4 additions & 1 deletion src/ridepy/extras/simulation_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ def param_combinations() -> Iterator[dict[str, dict[str, Any]]]:
def __next__(self):
return next(self._param_combinations)

def run(self, dry_run=False):
def run(self, dry_run: bool = False, info: bool = False):
"""
Run the simulations configured through `base_params`, `zip_params` and `product_params` using
multiprocessing. The parameters and resulting output events are written to disk
Expand All @@ -780,6 +780,8 @@ def run(self, dry_run=False):
----------
dry_run
If True, do not actually simulate.
info
Info/benchmark mode. If true, record the time it took to run each simulation run.
"""

self._simulation_ids = simulate_parameter_combinations(
Expand All @@ -792,6 +794,7 @@ def run(self, dry_run=False):
event_path_suffix=self._event_path_suffix,
param_path_suffix=self._param_path_suffix,
dry_run=dry_run,
info=info,
)

def __len__(self) -> int:
Expand Down

0 comments on commit 901b907

Please sign in to comment.