-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
mypy fixes for boids example #563
Conversation
@@ -43,7 +43,7 @@ def on_time_step(self, event: Event) -> None: | |||
# Pipeline sources and modifiers # | |||
################################## | |||
|
|||
def get_neighbors(self, index: pd.Index) -> pd.Series: | |||
def get_neighbors(self, index: pd.Index[int]) -> pd.Series[list[int]]: # type: ignore[type-var] |
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.
This is that someone common pandas error where it doesn't list out the entire line of expected items:
Type argument "list[int]" of "Series" must be a subtype of "str | bytes | date | time | bool | <10 more items>" [type-var]
s.set_offsets(frame_pops[i]) | ||
|
||
return FuncAnimation(fig, animate, frames=frames, interval=10) | ||
return FuncAnimation(fig, animate, frames=frames, interval=10) # type: ignore[arg-type] |
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.
FuncAnimation has the 2nd arg type-hinted as a callable that returns some obscure thing (certainly not None). It didn't seem worth it for a contrived example like this.
CHANGELOG.rst
Outdated
@@ -1,3 +1,7 @@ | |||
**3.2.12 - 12/27/24** |
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.
I think you need to merge from main again? I already released 3.2.12
plt.show() | ||
|
||
|
||
def plot_boids_animated(simulation): | ||
def plot_boids_animated(simulation: InteractiveContext) -> FuncAnimation: |
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.
Is this an InteractiveContext
or a SimulationContext
?
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.
I'm not really sure tbh. The example docs is all about interactive, but maybe it could be used in a simulation context?
Mypy fixes: boids example
Description
Changes and notes
Testing