-
Notifications
You must be signed in to change notification settings - Fork 0
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
Introduce indexing and slicing of TimePartition
#111
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.
@jwallwork23 - Looks straightforward and slicing will be useful.
I was wondering if the following line of code might also be impacted by the refactoring?
num_timesteps = self.time_partition[subinterval].num_timesteps
if num_timesteps > N:
…imesteps on sub-partition
Thanks @acse-ej321, good spot. In this snippet of code, we want to get the number of timesteps for a given subinterval. This could be done by taking the sub-timepartition and evaluating An equivalent but perhaps clearer way is to just take the appropriate index of (The pre-commit hook also seems to have put an unrelated formatting change in there, too.) |
Closes #99.
Currently, indexing a
TimePartition
returns various pieces of information associated with that subinterval. The changes introduced in this PR are more logical, i.e., indexing gives a sub-TimePartition
. Similarly for slicing.