-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
set numpy floating point error level to ignore. #238
Conversation
One line added, other line changes are whitespace removal. Does this need to be in our other files where numpy is imported, or does this act on numpy everywhere in the code? |
Ah yes, that's my editor stripping white space at the end.
I tried using the REMARK PR notebook with this branch, and the errors were gone even in functions defined outside of HARK. I wonder though if this also means that if you check out two packages, one being HARK and the other being, say, pandas, you'll also change the setting of pandas? |
Hm, yeah. Is that behavior that we want to foist on people?
…On Thu, Mar 14, 2019 at 10:12 AM Patrick Kofod Mogensen < ***@***.***> wrote:
One line added, other line changes are whitespace removal.
Ah yes, that's my editor stripping white space at the end.
Does this need to be in our other files where numpy is imported, or does
this act on numpy everywhere in the code?
I tried using the REMARK PR notebook with this branch, and the errors were
gone even in functions defined outside of HARK. I wonder though if this
also means that if you check out two packages, one being HARK and the other
being, say, pandas, you'll also change the setting of pandas?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#238 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ANUQFaskzdFf8tc2V9O1DZe3flxwnXnTks5vWljggaJpZM4b0AZO>
.
|
Then we can just turn it in and off at the beginning and end of a solve call? |
Yeah, maybe solve, simulate, and update? The "major" AgentType operations
where lots of work is done inside of HARK?
…On Thu, Mar 14, 2019 at 10:59 AM Patrick Kofod Mogensen < ***@***.***> wrote:
Then we can just turn it in and off at the beginning and end of a solve
call?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#238 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ANUQFcwCs_DB6ShoQ7t_zSDgL49hSj0uks5vWmPDgaJpZM4b0AZO>
.
|
I'll try that instead. |
…instead, as these will automatically reset upon exit.
How's this @mnwhite ? It uses error states instead, so every code in that This last commit sets the error state for A side-question: I tried to "hide" the white space changes. When you look at the diff, do they still show up? |
The whitespace changes show up on github.com's diff display, but I don't actually care. My comment was a note to self that there was only one line added, explaining why I was about to merge a PR with X hundred "line changes" a few minutes after it was submitted (my finger was hovering over the Merge button). |
Hi @pkofod, I'm going through PRs and adding a "needs release notes" label. Can you provide a one sentence summary of your changes, ideally by editing the issue itself (as opposed to leaving a comment), clearly labeled with "For release notes" or similar? Remember to specify if there are breaking changes in the PR. I'm not going to leave a comment like this on every merged PR of yours, but you can find a full list (well, full once I'm done tagging) here. |
For release notes: "Suppress some worrisome but meaningless warning messages" |
Release note: Removed inappropriately scary warnings about non-problems |
@llorracc this should do the job. It ignores the floating point exceptions. Currently we only warn anyway, so it's not like we're handling it.
The exceptions aren't really errors either as numpy calls them. They're well-defined operations that give useful answers. Things such as
-1/-np.inf
gives0
. This is very useful in DCEGM to interpolate from the lowest value to the first values of the resource grid that is not0
. It could be special handled, but this is implemented all the way down to the hardware level, so I don't see why we shouldn't just use it.For release notes
Several procedures in HARK actively take advantage of floating point behavior of
np.inf
's, division by zero and more. The default behavior in Numpy is to throw warnings in this case. These only risk confusing users who know little of floating point numbers, and so we turn them off in central methods used throughout HARK.