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

Better behavior with empty InferenceData #486

Closed
ColCarroll opened this issue Jan 3, 2019 · 2 comments
Closed

Better behavior with empty InferenceData #486

ColCarroll opened this issue Jan 3, 2019 · 2 comments
Labels

Comments

@ColCarroll
Copy link
Member

Describe the bug
An empty InferenceData object does not save at all, but will act as though it saved something. I think, but haven't checked, that this is because there is a loop over groups, and if there are no groups, we never save anything.

To Reproduce

import arviz as az
import os

filename = 'test.nc'
print(os.path.exists(filename))  # False
data = az.InferenceData()
filename = data.to_netcdf(filename)
print(os.path.exists(filename))  # False
print(filename)  # test.nc

Expected behavior
I would expect test.nc to exist on disk, as an empty netcdf file (or whatever happens when save is called on an empty netcdf file).

Ban-zee added a commit to Ban-zee/arviz that referenced this issue Jan 31, 2019
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 6, 2019
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 9, 2019
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 9, 2019
* Made changes to inference_data.py directly instead of io_netcdf.py as suggested.
* Added comments.
* Not included the tests yet!
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 9, 2019
* Made changes to inference_data.py directly instead of io_netcdf.py as suggested.
* Added comments.
* Not included the tests yet!
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 9, 2019
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 9, 2019
* Made changes to inference_data.py directly instead of io_netcdf.py as suggested.
* Added comments.
* Not included the tests yet!
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 18, 2019
Ban-zee added a commit to Ban-zee/arviz that referenced this issue Feb 18, 2019
* Made changes to inference_data.py directly instead of io_netcdf.py as suggested.
* Added comments.
* Not included the tests yet!
ColCarroll pushed a commit that referenced this issue Feb 21, 2019
…86). (#577)

* Issue no #486

* Made the following changes(#486):

* Made changes to inference_data.py directly instead of io_netcdf.py as suggested.
* Added comments.
* Not included the tests yet!

* *Resolved merge changes
*Not included tests yet!!

* Added the test

* moved the return statement outside the if-else block
@LakshyAAAgrawal
Copy link

Hey, is this issue still unresolved. If it is, I would like to take it up. Could someone point me in the right direction please?

@canyon289
Copy link
Member

@LakshyAAAgrawal This was closed by #577

Apologies on not closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants