Skip to content

Commit

Permalink
Sort dictionaries before hashing (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
dilpath authored Feb 1, 2024
1 parent b0bc936 commit ebcf5da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion petab_select/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def hashify(x: Any) -> str:

def hash_parameter_dict(dict_: TYPE_PARAMETER_DICT):
"""Hash a dictionary of parameter values."""
value = tuple(zip(dict_.keys(), dict_.values()))
value = tuple((k, dict_[k]) for k in sorted(dict_))
return hashify(value)


Expand Down
2 changes: 1 addition & 1 deletion petab_select/model_subspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def check_compatibility_stepwise_method(
'(e.g. forward or backward). '
f'This model subspace: `{self.model_subspace_id}`. '
'This model subspace PEtab YAML: '
f'`{self.petab_yaml}`.'
f'`{self.petab_yaml}`. '
'The candidate space PEtab YAML: '
f'`{candidate_space.predecessor_model.petab_yaml}`. '
)
Expand Down

0 comments on commit ebcf5da

Please sign in to comment.