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
StorageFrontend remoteness attribute and test #617
StorageFrontend remoteness attribute and test #617
Conversation
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.
Very nice! I think this is a great idea. just two small comments.
strax/context.py
Outdated
order in mind. Return the fastest first and try loading from it | ||
""" | ||
storage_sfs = self.storage | ||
storage_sfs.sort(key=lambda x: x.storage_type) |
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.
storage_sfs.sort(key=lambda x: x.storage_type) | |
storage_sfs = sorted(self.storage, key=lambda x: x.storage_type) |
I think you want to keep original list since order is used in copy_to_frontend
right? I think the way it is would sort in place the original list no?
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.
Nice!
strax/context.py
Outdated
:return: partial object | ||
""" | ||
for sb_i, sf in enumerate(self.storage): | ||
for _, sf in enumerate(self._sorted_storage): |
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.
for _, sf in enumerate(self._sorted_storage): | |
for sf in self._sorted_storage: |
double jeopardy!
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.
you are absolutely right!
Thanks a lot Yossi for the super quick and good review! I've implemented them both 👍 |
What is the problem / what does the code in this PR do
The issue is described here:
#566
Can you briefly describe how it works?
Rather than looping over the frontends in the order they were specified by the user, loop over the frontends in order of
StorageType
Can you give a minimal working example (or illustrate with a figure)?
See some examples in the test