-
Notifications
You must be signed in to change notification settings - Fork 6
Use getitem everywhere #115
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
Signed-off-by: Thijs Baaijen <[email protected]>
| """Base class to build a generator for grid elements""" | ||
|
|
||
| def __init__(self, grid: Grid, seed: int) -> None: | ||
| def __init__(self, grid: Grid, seed: int | None) -> None: |
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.
piggyback: This is a valid option and the current default in the RadialGridGenerator
Signed-off-by: Thijs Baaijen <[email protected]>
|
|
||
| @abstractmethod | ||
| def _get_shortest_path(self, source, target): ... | ||
| def _get_shortest_path(self, source, target) -> tuple[list[int], int]: ... |
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.
piggyback: add missing typehint
|
|
||
|
|
||
| def unique(array: T, **kwargs): | ||
| @overload |
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.
piggyback: add overload
Signed-off-by: Thijs Baaijen <[email protected]>
| array_field = self.find_array_field(array.__class__) | ||
|
|
||
| if hasattr(array, "id"): | ||
| if isinstance(array, IdArray): |
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.
Switch to instance check
|
| for branch_array in self.branch_arrays: | ||
| array = branch_array.filter(branch_ids) | ||
| if 0 < array.size != len(branch_ids): | ||
| if array.size > 0 and array.size != len(branch_ids): |
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.
piggyback: improve confusing logic



Replace
array.field_namewitharray["field_name"]ToDo: