Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

48 simplify notch approximation lawbinned #60

Merged
merged 10 commits into from
Jan 26, 2024

Conversation

maierbn
Copy link
Contributor

@maierbn maierbn commented Dec 21, 2023

No description provided.

@maierbn maierbn linked an issue Dec 21, 2023 that may be closed by this pull request
@maierbn maierbn self-assigned this Dec 21, 2023
Signed-off-by: Benjamin Maier <[email protected]>
Copy link
Member

@johannes-mueller johannes-mueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite an improvement, thanks. Please take a look at the one comment in the code.

Comment on lines 696 to 701
index = self._lut_primary_branch.load.searchsorted(np.abs(load.values))-1 # "-1", transform to zero-based indices

# raise error if requested load is higher than initialized maximum absolute load
if np.any(index+1 >= len(self._lut_primary_branch)):
raise ValueError(f"Binned class is initialized with a maximum absolute load of {self._maximum_absolute_load}, "\
f" but a higher absolute load value of |{load.max()}| is requested (in stress()).")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can ._find_load_index_or_raise(load) which finds the index of the load or raises if any of them is outside. Would remove code duplication and help readability.

Or at least introduce a method ._raise_if_requested_load_higher_than_max_abs_load(index, max_abs_load, max_load)

@johannes-mueller johannes-mueller added this to the 2.2.0 milestone Jan 25, 2024
@johannes-mueller
Copy link
Member

We should merge #67 ASAP to get the CI working again

Copy link
Member

@johannes-mueller johannes-mueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash?

@maierbn
Copy link
Contributor Author

maierbn commented Jan 26, 2024

I forgot the Sign-off again. Does it gets fixed with a squash? Then yes, please :-)

@johannes-mueller johannes-mueller merged commit 0384aee into develop Jan 26, 2024
9 of 10 checks passed
@johannes-mueller johannes-mueller deleted the 48-simplify-notch_approximation_lawbinned branch January 26, 2024 14:58
@johannes-mueller
Copy link
Member

Ok, thanks.

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.

Simplify notch_approximation_law.Binned
2 participants