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

Add representation to strax.StorageFrontend #342

Merged
merged 5 commits into from Oct 31, 2020
Merged

Conversation

JoranAngevaare
Copy link
Member

@JoranAngevaare JoranAngevaare commented Oct 30, 2020

What is the problem / what does the code in this PR do
This fixes #332

Can you briefly describe how it works?
It allows you to print the StorageFrontend Class providing you with more usefull info.

Can you give a minimal working example (or illustrate with a figure)?

st = straxen.contexts.xenonnt_online()
for sf in st.storage:
    print(sf)

returns

straxen.rundb.RunDB, readonly: True
strax.storage.files.DataDirectory, readonly: True, path: /dali/lgrandi/xenonnt/raw, take_only: ('raw_records', 'raw_records_he', 'raw_records_aqmon', 'raw_records_nv', 'raw_records_aqmon_nv', 'raw_records_mv')
strax.storage.files.DataDirectory, readonly: True, path: /dali/lgrandi/xenonnt/processed
strax.storage.files.DataDirectory, path: ./strax_data

This used to return:

<straxen.rundb.RunDB object at 0x7fa902955580>
<strax.storage.files.DataDirectory object at 0x7fa902955fd0>
<strax.storage.files.DataDirectory object at 0x7fa902955910>
<strax.storage.files.DataDirectory object at 0x7fa9029f4bb0>

Copy link
Contributor

@darrylmasson darrylmasson left a comment

Choose a reason for hiding this comment

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

Do we maybe also want to add a __str__ that returns the same? Might prevent some posts in tech support later.

@JoranAngevaare JoranAngevaare merged commit 86ec706 into master Oct 31, 2020
@JoranAngevaare JoranAngevaare deleted the patch_repr_sf branch October 31, 2020 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add __repr__ to storage frontends
2 participants