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

Commit

Permalink
unify type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
samwaseda committed Sep 9, 2024
1 parent 39f3723 commit ccf4418
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions pyiron_continuum/damask/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ def origin(self, value):

@staticmethod
def via_voronoi_tessellation(spatial_discretization, num_grains, box_size):
if isinstance(spatial_discretization, int) or isinstance(
spatial_discretization, float
):
if isinstance(spatial_discretization, (int, float)):
spatial_discretization = np.array(
[spatial_discretization, spatial_discretization, spatial_discretization]
)
if isinstance(box_size, int) or isinstance(box_size, float):
if isinstance(box_size, (int, float)):
box_size = np.array([box_size, box_size, box_size])
seed = seeds.from_random(box_size, num_grains)
return GeomGrid.from_Voronoi_tessellation(
Expand Down
6 changes: 3 additions & 3 deletions pyiron_continuum/toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ def Loading(solver, load_steps):
def generate_loading_tensor(default="F"):
return DAMASKCreator.generate_loading_tensor(default=default)

DAMASK.generate_loading_tensor.__func__.__doc__ = DAMASKCreator.generate_loading_tensor.__doc__
generate_loading_tensor.__func__.__doc__ = DAMASKCreator.generate_loading_tensor.__doc__

@staticmethod
def loading_tensor_to_dict(key, value):
return DAMASKCreator.loading_tensor_to_dict(key, value)

DAMASK.loading_tensor_to_dict.__func__.__doc__ = DAMASKCreator.loading_tensor_to_dict.__doc__
loading_tensor_to_dict.__func__.__doc__ = DAMASKCreator.loading_tensor_to_dict.__doc__

@staticmethod
def generate_load_step(
Expand Down Expand Up @@ -113,7 +113,7 @@ def generate_load_step(
estimate_rate=estimate_rate,
)

DAMASK.generate_load_step.__func__.__doc__ = DAMASKCreator.generate_load_step.__doc__
generate_load_step.__func__.__doc__ = DAMASKCreator.generate_load_step.__doc__

@staticmethod
def Material(rotation, elements, phase, homogenization):
Expand Down

0 comments on commit ccf4418

Please sign in to comment.