Skip to content

Commit

Permalink
Use setdefault for dictionary defaults
Browse files Browse the repository at this point in the history
Co-authored-by: Jacob Wilkins <46597752+oerc0122@users.noreply.github.com>
  • Loading branch information
k-harris27 and oerc0122 authored Feb 28, 2025
1 parent cfaa1d0 commit 609f105
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions janus_core/cli/geomopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ def _set_minimize_kwargs(
Scalar pressure when optimizing cell geometry, in GPa. Passed to the filter
function if either `opt_cell_lengths` or `opt_cell_fully` is True.
"""
if "opt_kwargs" not in minimize_kwargs:
minimize_kwargs["opt_kwargs"] = {}

if "traj_kwargs" not in minimize_kwargs:
minimize_kwargs["traj_kwargs"] = {}
minimize_kwargs.setdefault("opt_kwargs", {})
minimize_kwargs.setdefault("traj_kwargs", {})

# Check hydrostatic_strain and scalar pressure not duplicated
if "filter_kwargs" in minimize_kwargs:
Expand Down

0 comments on commit 609f105

Please sign in to comment.