Skip to content

Conversation

@vikram
Copy link

@vikram vikram commented Dec 2, 2014

Added a context manager to HDFStore

closes #8791

@jreback
Copy link
Contributor

jreback commented Dec 2, 2014

this is fine

pls add a release note in the enhancements section
pls review the docs in io.rst to see if anything needs to be changed

@jreback jreback added Enhancement IO HDF5 read_hdf, HDFStore labels Dec 2, 2014
@jreback jreback modified the milestones: 0.16.0, 0.15.2 Dec 2, 2014
@vikram
Copy link
Author

vikram commented Dec 2, 2014

@jreback I've updated the docs. Not sure if I've got it right.

@jreback
Copy link
Contributor

jreback commented Dec 2, 2014

pls squash, otherwise looks ok.

get_store now looks superfluous. Maybe we should deprecate in future versions?

@jorisvandenbossche

@jorisvandenbossche jorisvandenbossche changed the title Fixed #8791 add contextmanager ENH: add contextmanager to HDFStore (#8791) Dec 2, 2014
@vikram
Copy link
Author

vikram commented Dec 2, 2014

@jreback I've added warning that get_store is deprecated

Copy link
Contributor

Choose a reason for hiding this comment

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

take out the get_store still works..

@jorisvandenbossche
Copy link
Member

On the deprecation, I don't know if it is needed to really deprecate it, maybe we could only do "deprecation by documentation" (-> keeping it as an alias (and indicate this in the docstring of get_store) but use HDFStore everywhere in the documentation)

@vikram
Copy link
Author

vikram commented Dec 3, 2014

@jorisvandenbossche @jreback so I've made those changes. Sorry misunderstood that you guys wanted it deprecated.

@jreback
Copy link
Contributor

jreback commented Dec 3, 2014

ok, pls add a release note (put in enhancements section)

Copy link
Member

Choose a reason for hiding this comment

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

I think we should add here something to the docstring of get_store that is is an alias of HDFStore -> better to use that.
You can use pd.util.decorators.Appender for that. Something like:

get_store = Appender("Backwards compatible alias for ``HDFStore``", join='\n')(HDFStore)
Copy link
Author

Choose a reason for hiding this comment

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

I've added that now.

instead of having to use

with get_store('file.h5') as store:
    store.keys()

now we can do

with HDFStore('file.h5') as store:
    store.keys()
@jreback
Copy link
Contributor

jreback commented Dec 4, 2014

looks ok to me. ping on green.

@vikram
Copy link
Author

vikram commented Dec 4, 2014

@jreback it's green

@jreback jreback merged commit 924c62e into pandas-dev:master Dec 4, 2014
@jreback
Copy link
Contributor

jreback commented Dec 4, 2014

@vikram thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement IO HDF5 read_hdf, HDFStore

3 participants