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

MAINT: Error out gracefully with an unsupported scheduler #162

Merged
merged 3 commits into from
Apr 22, 2024

Conversation

MridulS
Copy link
Member

@MridulS MridulS commented Apr 17, 2024

No description provided.

Copy link
Member

@SimonHeybrock SimonHeybrock left a comment

Choose a reason for hiding this comment

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

👍

@SimonHeybrock
Copy link
Member

mypy is failing.

@MridulS
Copy link
Member Author

MridulS commented Apr 17, 2024

Yeah, runtime checks conflicts with mypy.

I don't know what's the best practice here. If there is type annotated code already should there be no unit test for isinstance checks? Or should mypy just be silenced there? mypy here will also complain about the code being unreachable as the variable scheduler is already type annoated as Scheduler so there shouldn't be a case where scheduler is not an instance of something that follows the Scheduler protocol according to the type information. But this requires the user to write their code in a type checking enabled IDE (I was doing this is in a vanilla jupyter notebook and hence tripping up on this)

@SimonHeybrock
Copy link
Member

Yeah, runtime checks conflicts with mypy.

I don't know what's the best practice here. If there is type annotated code already should there be no unit test for isinstance checks? Or should mypy just be silenced there?

I do not know either, we have selectively ignored mypy in other places as well, so maybe go with that?

@MridulS MridulS enabled auto-merge April 22, 2024 07:03
@MridulS MridulS merged commit 03b0a16 into scipp:main Apr 22, 2024
5 checks passed
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