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

Typecheck some API interfaces #593

Merged
merged 28 commits into from
Sep 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
19e2e99
Add typechecking and action config
mfisher87 Sep 4, 2024
4cc2eb9
Typecheck granules module
mfisher87 Sep 4, 2024
041c5ba
Correct invalid type annotation
mfisher87 Aug 14, 2024
a43a25e
Flesh out CMR params & EGI subset types
mfisher87 Aug 26, 2024
3fc95f1
Define generic type annotation for Parameters class
mfisher87 Aug 26, 2024
b9c77e8
Partially annotate the Query class
mfisher87 Sep 4, 2024
da851aa
Add miscellaneous annotation
mfisher87 Aug 26, 2024
2da7a0b
Add all dependencies to typecheck environment
mfisher87 Aug 27, 2024
c8ba01a
Add notes to pyright config
mfisher87 Aug 27, 2024
27f4641
Remove pyright ignores for modules without any errors
mfisher87 Sep 4, 2024
181099f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 4, 2024
e6e7fe2
Clarify use of term "EGI" in docstring
mfisher87 Sep 4, 2024
0440fa9
Type valid data product short names
mfisher87 Sep 4, 2024
df78ca2
Fixup API parameter types
mfisher87 Sep 5, 2024
ee70196
Fixup missed name change
mfisher87 Sep 5, 2024
434c28a
Use Python 3.9-compatible annotation style
mfisher87 Sep 5, 2024
a36d17c
Correct product name type name
mfisher87 Sep 12, 2024
a8996d1
Narrow argument types
mfisher87 Sep 12, 2024
dfe4c09
Set pyright's Python version to 3.9
mfisher87 Sep 12, 2024
fddf23a
Unblock upgrading sphinx extensions by replacing sphinx-panels
mfisher87 Sep 12, 2024
e155a9b
Parse and correctly generate docs from numpy-style docstrings
mfisher87 Sep 12, 2024
51b3492
Fix typo
mfisher87 Sep 13, 2024
7f60849
Autogenerate docs for types
mfisher87 Sep 13, 2024
4cb5956
Tell the typechecker to trust us on the type of reqparams
mfisher87 Sep 13, 2024
7a423a8
Tweak style of panels in index page
mfisher87 Sep 13, 2024
6a4acd9
Rename "Specific" classes to "Required"
mfisher87 Sep 13, 2024
e41aed0
Mark EGI subset shape params NotRequired
mfisher87 Sep 13, 2024
81d60dd
Merge branch 'development' into refactor-and-typecheck-api-interfaces
JessicaS11 Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix typo
Co-authored-by: Jessica Scheick <[email protected]>
mfisher87 and JessicaS11 authored Sep 13, 2024
commit 51b34923f834b2e20472c85d8f64a72f5a377c8e
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@
suppress_warnings = ["myst.header"] # suppress non-consecutive header warning


# -- Options for Napoleon docstrign parsing ----------------------------------
# -- Options for Napoleon docstring parsing ----------------------------------
napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_use_admonition_for_examples = True

Unchanged files with check annotations Beta

request.raise_for_status()
esir_root = ET.fromstring(request.content)
if verbose is True:
print("Order request URL: ", unquote(request.url))

Check warning on line 374 in icepyx/core/granules.py

Codecov / codecov/patch

icepyx/core/granules.py#L374

Added line #L374 was not covered by tests
print(
"Order request response XML content: ",
request.content.decode("utf-8"),
loop_root = ET.fromstring(loop_response.content)
# Continue loop while request is still processing
loop_root = None

Check warning on line 417 in icepyx/core/granules.py

Codecov / codecov/patch

icepyx/core/granules.py#L417

Added line #L417 was not covered by tests
while status == "pending" or status == "processing":
print(
"Your order status is still ",
# point. We know for sure this shouldn't be possible, though, because
# the while loop should run once.
# See: https://github.com/microsoft/pyright/discussions/2033
raise RuntimeError("Programmer error!")

Check warning on line 446 in icepyx/core/granules.py

Codecov / codecov/patch

icepyx/core/granules.py#L446

Added line #L446 was not covered by tests
# Order can either complete, complete_with_errors, or fail:
# Provide complete_with_errors error message:
if "email" in self._reqparams.fmted_keys or email is False:
self._reqparams.build_params(**self._reqparams.fmted_keys)
elif email is True:
user_profile = self.auth.get_user_profile() # pyright: ignore[reportAttributeAccessIssue]

Check warning on line 1011 in icepyx/core/query.py

Codecov / codecov/patch

icepyx/core/query.py#L1011

Added line #L1011 was not covered by tests
self._reqparams.build_params(
**self._reqparams.fmted_keys, email=user_profile["email_address"]
)
import geoviews as gv
from shapely.geometry import Polygon # noqa: F401
gv.extension("bokeh") # pyright: ignore[reportCallIssue]

Check warning on line 1145 in icepyx/core/query.py

Codecov / codecov/patch

icepyx/core/query.py#L1145

Added line #L1145 was not covered by tests
bbox_poly = gv.Path(gdf["geometry"]).opts(color="red", line_color="red")
tile = gv.tile_sources.EsriImagery.opts(width=500, height=500)
return tile * bbox_poly # pyright: ignore[reportOperatorIssue]

Check warning on line 1149 in icepyx/core/query.py

Codecov / codecov/patch

icepyx/core/query.py#L1149

Added line #L1149 was not covered by tests
except ImportError:
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres")) # pyright: ignore[reportAttributeAccessIssue]

Check warning on line 1152 in icepyx/core/query.py

Codecov / codecov/patch

icepyx/core/query.py#L1152

Added line #L1152 was not covered by tests
f, ax = plt.subplots(1, figsize=(12, 6))
world.plot(ax=ax, facecolor="lightgray", edgecolor="gray")
gdf.plot(ax=ax, color="#FF8C00", alpha=0.7)