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

feat: Improving the flexibility of reading vaults #16

Closed
wants to merge 1 commit into from

Conversation

callumtilbury
Copy link
Contributor

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.

  • If timesteps or percentiles are requested, return a "full" buffer, with the appropriate data.
  • Otherwise return all the vault data, but with the following check—if vault_index < fbx_buffer_state_size, make the returned buffer the original buffer size, with is_full = False; otherwise, return a full buffer.

),
)
read_buffer_is_full = self.vault_index >= self._buffer_time_axis_len
read_buffer_index = self.vault_index
Copy link
Contributor

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
Copy link
Contributor

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]
Copy link
Contributor

Choose a reason for hiding this comment

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

potentially here as well

@callumtilbury
Copy link
Contributor Author

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 :)

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.

2 participants