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

Mypy for intervals #55

Merged
merged 9 commits into from
Dec 18, 2023
Merged

Mypy for intervals #55

merged 9 commits into from
Dec 18, 2023

Conversation

AdrianSosic
Copy link
Collaborator

Enables mypy for the Interval class, which are used by targets (done in #54) and parameters (done in #28). Along the way, adds missing type hints and cleans up the class properties.

In particular, replaces the somewhat misleading is_finite and is_bounded methods with the common and easy-to-understand mathematical definitions is_open, is_half_open and is_closed, ensuring backward compatibility via deprecation mechanisms.

@AVHopp , @Scienfitz: Note that the PR builds upon #54, in order to configure the right diff view.

@AdrianSosic AdrianSosic added the typing Typing related things label Dec 8, 2023
@AdrianSosic AdrianSosic added this to the Mypy milestone Dec 8, 2023
@AdrianSosic AdrianSosic self-assigned this Dec 8, 2023
Copy link
Collaborator

@AVHopp AVHopp left a comment

Choose a reason for hiding this comment

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

We need to discuss and adjust the terminology that we use here as it is just not correct.

baybe/utils/interval.py Outdated Show resolved Hide resolved
baybe/utils/interval.py Outdated Show resolved Hide resolved
baybe/utils/interval.py Outdated Show resolved Hide resolved
mypy.ini Show resolved Hide resolved
baybe/targets/numerical.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@AVHopp AVHopp left a comment

Choose a reason for hiding this comment

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

Looking gucci to me now :)

baybe/utils/interval.py Show resolved Hide resolved
baybe/utils/interval.py Show resolved Hide resolved
baybe/utils/interval.py Show resolved Hide resolved
@AdrianSosic AdrianSosic merged commit 85dd96a into main Dec 18, 2023
7 checks passed
@AdrianSosic AdrianSosic deleted the mypy/interval branch December 18, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typing Typing related things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants