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

Set/fix typehints in visualize/profiles.py / visualize/reference_poin… #1223

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

dweindl
Copy link
Member

@dweindl dweindl commented Nov 29, 2023

…ts.py

And remove redundant / contradictory types from docstrings

@dweindl dweindl requested a review from a team as a code owner November 29, 2023 16:49
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2023

Codecov Report

Attention: 396 lines in your changes are missing coverage. Please review.

Comparison is base (160c2a8) 88.16% compared to head (2299b85) 84.11%.
Report is 451 commits behind head on develop.

Files Patch % Lines
pypesto/ensemble/ensemble.py 69.36% 68 Missing ⚠️
...ypesto/hierarchical/spline_approximation/solver.py 83.68% 47 Missing ⚠️
pypesto/ensemble/util.py 65.13% 38 Missing ⚠️
pypesto/hierarchical/optimal_scaling/solver.py 93.53% 26 Missing ⚠️
pypesto/history/base.py 88.57% 24 Missing ⚠️
pypesto/hierarchical/petab.py 84.56% 23 Missing ⚠️
pypesto/engine/mpi_pool.py 0.00% 22 Missing ⚠️
pypesto/hierarchical/inner_calculator_collector.py 89.04% 16 Missing ⚠️
...pesto/hierarchical/spline_approximation/problem.py 89.18% 16 Missing ⚠️
pypesto/hierarchical/optimal_scaling/calculator.py 75.86% 14 Missing ⚠️
... and 19 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1223      +/-   ##
===========================================
- Coverage    88.16%   84.11%   -4.06%     
===========================================
  Files           79      148      +69     
  Lines         5257    11857    +6600     
===========================================
+ Hits          4635     9973    +5338     
- Misses         622     1884    +1262     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dweindl dweindl self-assigned this Nov 29, 2023
Copy link
Contributor

@Doresic Doresic left a comment

Choose a reason for hiding this comment

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

Nice changes, thank you.
For my information, descriptions like profile_indices: list of integer values are not nice, so that's why you're removing and adding them to the function input like Sequence[int]?

@@ -15,50 +15,50 @@ def profiles(
results: Union[Result, Sequence[Result]],
ax=None,
profile_indices: Sequence[int] = None,
size: Sequence[float] = (18.5, 6.5),
size: tuple[float, float] = (18.5, 6.5),
reference: Union[ReferencePoint, Sequence[ReferencePoint]] = None,
colors=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be colors: Sequence[tuple] or something similar?

Copy link
Member Author

Choose a reason for hiding this comment

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

"or something similar" 😅
I am not completely sure which types are supported.

@dweindl
Copy link
Member Author

dweindl commented Nov 30, 2023

For my information, descriptions like profile_indices: list of integer values are not nice, so that's why you're removing and adding them to the function input like Sequence[int]?

They are not bad per se. However, proper type annotations can be used for static code analysis, those other comments cannot. And redundancy is bad. Also, as you can see in some of the changes, those comments don't reflect the actually expected types.

@dweindl dweindl merged commit 6ec4fc9 into ICB-DCM:develop Nov 30, 2023
18 checks passed
@dweindl dweindl deleted the fix_typehints branch November 30, 2023 14:35
This was referenced Dec 5, 2023
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.

3 participants