Skip to content

Proper checking for np.array == None#48

Merged
jonaslindemann merged 1 commit into
CALFEM:masterfrom
ErikHasselwander:patch-1
Sep 28, 2023
Merged

Proper checking for np.array == None#48
jonaslindemann merged 1 commit into
CALFEM:masterfrom
ErikHasselwander:patch-1

Conversation

@ErikHasselwander
Copy link
Copy Markdown
Contributor

The current codebase checks np.array == None in a lot of places, for instance for body forces in core.planqe. This causes an exception in numpy, crashing the program.

This change instead uses the np.array is None pattern to do such checks, as it instead compares the type of the array to None, rather than the value (which == does).

The current codebase checks `np.array == None` in a lot of places, for instance for body forces in core.planqe. This causes an exception in numpy, crashing the program. 

This change instead uses the `np.array is None` pattern to do such checks, as it instead compares the type of the array to None, rather than the value (which == does).
@jonaslindemann jonaslindemann merged commit b9ea36d into CALFEM:master Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants