Skip to content

Error in examples: Microstructure hollow cube #465

@clemens-fricke

Description

@clemens-fricke

When running the examples two examples ['splinepy/examples/show_readme.py', 'splinepy/examples/show_microstructures.py'] fail both at the same part:

Traceback (most recent call last):
  File "splinepy/examples/show_readme.py", line 276, in <module>
    splinepy.microstructure.tiles.show(alpha=0.7, background=bg)
  File "xxx/envs/testsplinepy/lib/python3.12/site-packages/splinepy/microstructure/tiles/__init__.py", line 174, in show
    to_show.append([key, Multipatch(value().create_tile()[0])])
                                    ^^^^^^^^^^^^^^^^^^^^^
  File "xxx/envs/testsplinepy/lib/python3.12/site-packages/splinepy/microstructure/tiles/hollow_cube.py", line 75, in create_tile
    (parameters[:, 2:] > _np.deg2rad(-30))
ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty.

and

^[Traceback (most recent call last):
  File "splinepy/examples/show_microstructures.py", line 45, in <module>
    splinepy.microstructure.tiles.show(
  File "xxx/envs/testsplinepy/lib/python3.12/site-packages/splinepy/microstructure/tiles/__init__.py", line 174, in show
    to_show.append([key, Multipatch(value().create_tile()[0])])
                                    ^^^^^^^^^^^^^^^^^^^^^
  File "xxx/envs/testsplinepy/lib/python3.12/site-packages/splinepy/microstructure/tiles/hollow_cube.py", line 75, in create_tile
    (parameters[:, 2:] > _np.deg2rad(-30))
ValueError: The truth value of an empty array is ambiguous. Use `array.size > 0` to check that an array is not empty.

I am not sure where this directly comes from. @markriegler, you are currently the one with the most expertise in the microstructure code. Could you take a look at this?

This also does not show up in the tests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions