-
Notifications
You must be signed in to change notification settings - Fork 47
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
delete_nan_inf can handle list input type #1243
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #1243 +/- ##
========================================
Coverage 83.87% 83.87%
========================================
Files 148 148
Lines 12067 12071 +4
========================================
+ Hits 10121 10125 +4
Misses 1946 1946 ☔ View full report in Codecov by Sentry. |
@@ -375,7 +375,7 @@ def stats_lowlevel( | |||
The plot axes. | |||
""" | |||
fvals = result.optimize_result.fval | |||
values = [res[property_name] for res in result.optimize_result.list] | |||
values = [[res[property_name]] for res in result.optimize_result.list] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is making that specifically a list within a list required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is making the use of delete_nan_inf
consistent.
The values are given over to delete_nan_inf
in place of the optimization result parameters. These are parameter vectors within a list, i.e. one list (or None
) per start.
Does anyone know where this condition is needed? It seems counter-intuitive because the function deletes nan values from the given list. Lines 282 to 296 in c012c19
|
No idea where it's needed. Yes, it's deletes the nans, but it makes sure that the dimensions of |
|
||
# parse fvals and parameters | ||
fvals = np.array(fvals) | ||
# remove nan or inf values | ||
xs, fvals = delete_nan_inf( | ||
fvals=fvals, | ||
x=xs, | ||
xdim=len(ub) if ub is not None else 1, | ||
magnitude_bound=WATERFALL_MAX_VALUE, | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving the delete_nan_inf
to here makes it so the plotting of reference points doesn't go through it. Is that an issue? I've never used reference points, but they also possibly might contain infinite/nan values, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, it's not a problem though, nans are just not shown in the line plot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine, branch needs update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thank you
None
#1107None
to numpy arrayNone
from parameter vector withindelete_nan_inf
x=None