-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Improving the behaviour of an empty InferenceData object. (Issue no 486). #577
Conversation
@Ban-zee Please add tests as well |
Thanks for this contribution! A few suggestions:
|
Definitely, will keep that in mind in the future. I'll make the necessary changes. |
@Ban-zee If you want to practice you can change the title of this PR and amend your commit to have a more useful message :) |
A minor question, exactly what test should I include as the test for checking an inference object's existence is already included in test_data.py. TIA. |
I would add a meaningful test for these lines that are currently not tested Reading this over a bit more too can we add a doc string that briefly explains why the if else is there? To consolidate comments here's what I would like for an approval
|
@Ban-zee Thanks for the title change :) |
Sorry for keeping this PR open for so long, I was a bit busy this past
week. Regarding the addition of tests, it would be helpful if anyone could
guide me through that process.
…On Sat, Feb 9, 2019 at 8:16 AM Ravin Kumar ***@***.***> wrote:
@Ban-zee <https://github.com/Ban-zee> Thanks for the title change :)
If you need help with the other asks let us know! We're here to help
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#577 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcC4Dihks0NcPS2Fngcm5gPDflIueptbks5vLjadgaJpZM4adBGQ>
.
|
@Ban-zee Don't worry about how long you keep the PR open, there's no timeline in open source! For testing, are you familiar with pytest or testing principles in general? Trying to get a baseline of where you're at so I can guide you appropriately |
Thinking of pushing my commits with the other changes you suggested(other
than the tests), but git keeps rejecting it as the tip of my local branch
is behind the remote. Tried resolving it but nothing seem to work. Should I
just force push?
Regarding the tests, I have gone through the pytest documentation and have
looked into the tests included in this project. It would be helpful if you
could tell me how to add my tests to the ones which already exist (in my
case mainly for the else block).
…On Sat, Feb 9, 2019 at 9:06 PM Ravin Kumar ***@***.***> wrote:
@Ban-zee <https://github.com/Ban-zee> Don't worry about how long you keep
the PR open, there's no timeline in open source!
For testing, are you familiar with pytest or testing principles in
general? Trying to get a baseline of where you're at so I can guide you
appropriately
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#577 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcC4Dj8-kbeDJmlateu5a3d55jBmelOpks5vLusFgaJpZM4adBGQ>
.
|
When you do a "destructive" git command like amend you have to force push. Just be careful because if you mess up the command its becomes more difficult to go back, and in some cases impossible. For the data functions I would look at this module and this test. It'll give you an idea how things are implemented https://github.com/arviz-devs/arviz/blob/master/arviz/tests/test_data.py#L651 |
Let's say it is impossible. (It is just really really hard, but doable) |
I did use amend. I'll have to force push anyway now.
…On Sun, Feb 10, 2019 at 3:39 PM Ari Hartikainen ***@***.***> wrote:
Let's say it is impossible. (It is just really really hard, but doable)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#577 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AcC4DkVoMGt6OE1zRaBHpqNkOb6NZxO-ks5vL-_SgaJpZM4adBGQ>
.
|
* Made changes to inference_data.py directly instead of io_netcdf.py as suggested. * Added comments. * Not included the tests yet!
*Not included tests yet!!
Getting the following error: "No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself." Any idea on what should be done? |
That happens sometimes (travis freezes). Restarting the job usually works (might need admin rights, so usually someone from the devteam can do it). |
Thank you. |
Hrm... fails on Python 3.5, but not Python 3.6. I restarted in case it is a flaky test, but here's the message:
|
Any idea on why the test fails in python 3.5 but not in 3.6? |
arviz/data/inference_data.py
Outdated
data.to_netcdf(filename, mode=mode, group=group, **kwargs) | ||
data.close() | ||
mode = "a" | ||
return filename |
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.
here is indentation error.
You could return filename
at the end of the function.
arviz/data/inference_data.py
Outdated
else: # creates a netcdf file for an empty InferenceData object. | ||
empty_netcdf_file = nc.Dataset(filename, mode="w", format="NETCDF4") | ||
empty_netcdf_file.close() | ||
return filename |
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.
remove the first return filename
and return this outside the if-else block. (indent back)
Made the changes. Thank you for your help. Are there any more changes to be made prior to merging? |
Any other change I have to make before merging? |
This looks good -- thank you for the contribution @Ban-zee! |
Addressing issue #486