Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Make a conversion only if old tags are included
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Sep 6, 2024
1 parent 1987b7f commit 5f0ef5f
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions pyiron_continuum/damask/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,19 +178,18 @@ def __init__(self, solver, load_steps):
super(DamaskLoading, self).__init__(self)

def __new__(cls, solver, load_steps):
loading_dict = dict()
loading_dict["solver"] = solver
if not isinstance(load_steps, list):
load_steps = [load_steps]
loading_dict["loadstep"] = [
LoadStep(
mech_bc_dict=load_step["mech_bc_dict"],
discretization=load_step["discretization"],
additional_parameters_dict=load_step["additional"],
)
for load_step in load_steps
]
return YAML(solver=loading_dict["solver"], loadstep=loading_dict["loadstep"])
if "mech_bc_dict" in load_steps[0]:
load_steps = [
LoadStep(
mech_bc_dict=load_step["mech_bc_dict"],
discretization=load_step["discretization"],
additional_parameters_dict=load_step["additional"],
)
for load_step in load_steps
]
return YAML(solver=solver, loadstep=load_steps)


class LoadStep(dict):
Expand Down

0 comments on commit 5f0ef5f

Please sign in to comment.