Modernize type hints to PEP 604/built-in generics across the codebase (grid/neighbors/subset/plot/dataset modules), replacing Optional/Union/List/Dict/Tuple/Set with | unions and built-in generics
Old style (pre-PEP 604):
- Union[str, int]
- Optional[bool] (alias for Union[bool, None])
New style (PEP 604, Python 3.10+):
- str | int
- bool | None