Skip to content

Conversation

@Thijss
Copy link
Member

@Thijss Thijss commented Nov 12, 2025

Replace array.field_name with array["field_name"]

ToDo:

  • run performance tests and compare with main to be sure

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:
Copy link
Member Author

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


@abstractmethod
def _get_shortest_path(self, source, target): ...
def _get_shortest_path(self, source, target) -> tuple[list[int], int]: ...
Copy link
Member Author

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
Copy link
Member Author

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):
Copy link
Member Author

Choose a reason for hiding this comment

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

Switch to instance check

@sonarqubecloud
Copy link

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):
Copy link
Member Author

@Thijss Thijss Nov 12, 2025

Choose a reason for hiding this comment

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

piggyback: improve confusing logic

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