Skip to content
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

Sbachmei/mic 5395/mypy event #516

Merged
merged 2 commits into from
Oct 24, 2024
Merged

Conversation

stevebachmeier
Copy link
Contributor

Fix mypy errors in framework/event.py

Description

Changes and notes

Testing

#: The simulation time at which this event will resolve. The current
#: simulation size plus the current time step size.
# FIXME [MIC-5468]: fix index type hint for mypy
index: pd.Index[int] # type: ignore[assignment]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ignored because NamedTuple has an index method. We can either change the name of this attr or switch to a @dataclass(frozen=True)

@@ -113,7 +118,7 @@ def emit(self, index: pd.Index, user_data: Optional[Dict] = None) -> Event:
e = Event(
index,
user_data,
self.manager.clock() + self.manager.step_size(),
self.manager.clock() + self.manager.step_size(), # type: ignore[operator, arg-type]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to sort out the clock type hints here. They include Number which don't all have add implemented.

@stevebachmeier stevebachmeier merged commit a42e397 into main Oct 24, 2024
6 checks passed
@stevebachmeier stevebachmeier deleted the sbachmei/mic-5395/mypy-event branch October 24, 2024 17:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants