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

Direct access to data file path #12

Open
jbarnoud opened this issue Jul 18, 2016 · 3 comments
Open

Direct access to data file path #12

jbarnoud opened this issue Jul 18, 2016 · 3 comments

Comments

@jbarnoud
Copy link

Data are stored in HDF5 or pickle files. As suggested in #11, it would be convenient to have a method to get the path to the file where a data is stored from the key of that data.

The method would be used in that way:

t = Treant('baobab')
t.data['mydata'] = np.arange(5)
path = t.filepath('mydata')

Having simple access to the path also give access to the file file system properties such as the date of last modification (see #11).

@jbarnoud
Copy link
Author

I cannot assign myself, but I'll try to take care of this in a not to distant future.

@dotsdl
Copy link
Member

dotsdl commented Jul 18, 2016

No problem @jbarnoud. Thanks! Let me know if you want some guidance on how to go about this, but the best way forward is to probably dig around the codebase of datreant.data yourself and see how the data limb already identifies the data files inside a file tree.

@dotsdl
Copy link
Member

dotsdl commented Jul 18, 2016

Just had a quick look. Probably the best way to do this is to simply use Data._get_datafile internally inside Data.filepath. It will be a one-liner to get what you want in this way.

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

No branches or pull requests

2 participants