Skip to content

Commit

Permalink
update doctests for numpy 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zebengberg committed Dec 11, 2024
1 parent 9970828 commit 2557c84
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doctest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ jobs:
- name: Test notebooks
run: make nb-test

# The doctests require numpy 2.0 or higher
# The doctests require numpy 2.2 or higher
- name: Test docstrings
run: |
pip install "numpy>=2.0"
pip install "numpy>=2.2"
make doctest
2 changes: 1 addition & 1 deletion pycontrails/core/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ def length_met(self, key: str, threshold: float = 1.0) -> float:
>>> fl["air_temperature"] = fl.intersect_met(met["air_temperature"])
>>> fl["air_temperature"]
array([235.94657007, 235.55745645, 235.56709768, ..., 234.59917962,
234.60387402, 234.60845312])
234.60387402, 234.60845312], shape=(1081,))
>>> # Length (in meters) of waypoints whose temperature exceeds 236K
>>> fl.length_met("air_temperature", threshold=236)
Expand Down
2 changes: 1 addition & 1 deletion pycontrails/core/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ def vector_to_lon_lat_grid(
...,
[1.97, 3.02, 1.84, ..., 2.37, 3.87, 2.09],
[3.74, 1.6 , 4.01, ..., 4.6 , 4.27, 3.4 ],
[2.97, 0.12, 1.33, ..., 3.54, 0.74, 2.59]])
[2.97, 0.12, 1.33, ..., 3.54, 0.74, 2.59]], shape=(40, 40))
>>> da.sum().item() == vector["foo"].sum()
np.True_
Expand Down
2 changes: 1 addition & 1 deletion pycontrails/datalib/goes.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ class GOES:
[277.24512, 277.45377, 278.18408, ..., 274.6369 , 274.01093,
274.06308],
[276.8278 , 277.14078, 277.7146 , ..., 274.6369 , 273.9066 ,
274.16742]], dtype=float32)
274.16742]], shape=(500, 500), dtype=float32)
"""

Expand Down

0 comments on commit 2557c84

Please sign in to comment.