-
Notifications
You must be signed in to change notification settings - Fork 139
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
Type annotations, mypy config, pydoclint setup, and other changes #1660
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 21, 2024 15:05
3f9a52b
to
217e1c2
Compare
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 23, 2024 13:02
a28bd6b
to
5a5a699
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1660 +/- ##
==========================================
- Coverage 86.40% 81.03% -5.38%
==========================================
Files 67 69 +2
Lines 11746 13118 +1372
Branches 0 125 +125
==========================================
+ Hits 10149 10630 +481
- Misses 1597 2451 +854
- Partials 0 37 +37
Flags with carried forward coverage won't be shown. Click here to find out more.
|
_compat.py file was mentioned in https://learn.scientific-python.org/development/patterns/backports/#placement-in-a-file . Thought it would be useful to consolidate MPI stuff
Need to investigate the use of `TYPE_CHECKING` as it causes runtime `NameErrors` even when only used as annotations.
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 27, 2024 11:49
9942975
to
6ebda1c
Compare
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 27, 2024 12:06
6ebda1c
to
a2b6127
Compare
- Add concurrency for workflows (so repeated pushes on the same branch cancel previous workflow run) - Add dependabot for GHA version updating - Add prettier as formatter (removing Biome as it didn't format the needed files) - --show-fixes in ruff config Used https://learn.scientific-python.org/development/guides/repo-review/ to highlight suggested changes in project configuration. Some items (upload-artifact version change, nox/tox integration, spell checker, pytest options) weren't included as they add maintainence burden beyond their benefits, or hinder development (codespell).
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 27, 2024 12:08
a2b6127
to
4dcd89e
Compare
VeckoTheGecko
changed the title
[WIP] Type annotations, mypy config, pydoclint setup
Type annotations, mypy config, pydoclint setup, and other changes
Aug 27, 2024
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 27, 2024 12:32
8ad0ea0
to
b53a95e
Compare
VeckoTheGecko
force-pushed
the
v/type-annotations
branch
from
August 27, 2024 12:39
b53a95e
to
5f85aa7
Compare
VeckoTheGecko
commented
Aug 27, 2024
erikvansebille
approved these changes
Aug 28, 2024
Fixes #1653 . Refactoring to reduce code duplication in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces typing to the Parcels codebase, providing:
The coverage for this isn't 100% yet (as doing so is quite difficult with the current codebase), but as we refactor code it will get easier to increase our coverage.
Changes
Typing:
parcels
functions/methods are also checked_typing.py
file to define types used throughout ParcelsOther:
pydoclint
tooling to pre-commit to help capture docstring errors not picked up by Ruff_compat.py
file to help with compatibility between installations when using mpi