-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Improving the flexibility of reading vaults #16
Conversation
), | ||
) | ||
read_buffer_is_full = self.vault_index >= self._buffer_time_axis_len | ||
read_buffer_index = self.vault_index |
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.
Does this make sense in every case? If the vault buffer is larger than the buffer time axis then a full buffer is returned, wouldn't the read buffer index then need to be set to zero?
read_interval = (self.vault_index - timesteps, self.vault_index) | ||
# If timesteps are provided, we always return a full buffer state | ||
read_buffer_is_full = True | ||
read_buffer_index = timesteps |
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.
Same potential issue
assert ( | ||
percentiles[0] < percentiles[1] | ||
), "Percentiles must be in ascending order." | ||
read_interval = ( | ||
int(self.vault_index * (percentiles[0] / 100)), | ||
int(self.vault_index * (percentiles[1] / 100)), | ||
) | ||
# If percentiles are provided, we always return a full buffer state | ||
read_buffer_is_full = True | ||
read_buffer_index = read_interval[1] - read_interval[0] |
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.
potentially here as well
Going to revisit the reading of vaults at some point, but we can restart the discussion when that happens—with some careful thought. For now, I am closing this :) |
My first suggestion for #15. We could make things more explicit (handling everything a user may possibly want), but I also want to keep the code fairly streamlined & straightforward. Open to discussion.
timesteps
orpercentiles
are requested, return a "full" buffer, with the appropriate data.vault_index
<fbx_buffer_state_size
, make the returned buffer the original buffer size, withis_full = False
; otherwise, return a full buffer.