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

Move to python 3.10 in CI and remove python 3.7 #279

Merged
merged 21 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f7f6108
Merge pull request #6 from GlacioHack/main
rhugonnet Mar 27, 2021
9c97f54
Merge branch 'GlacioHack:main' into main
rhugonnet Jun 17, 2021
3a48737
Merge branch 'GlacioHack:main' into main
rhugonnet Jul 23, 2021
c7f18be
Merge remote-tracking branch 'upstream/main'
rhugonnet Aug 9, 2021
bcd5163
Merge remote-tracking branch 'upstream/main'
rhugonnet Aug 13, 2021
864fabd
fix deramp residual and optimizer
rhugonnet Aug 13, 2021
cad1f68
Merge remote-tracking branch 'upstream/main'
rhugonnet Sep 6, 2021
561e4f2
Merge remote-tracking branch 'upstream/main'
rhugonnet Sep 8, 2021
270060e
Merge remote-tracking branch 'upstream/main'
rhugonnet Oct 14, 2021
3acaa2b
Merge remote-tracking branch 'upstream/main'
rhugonnet Nov 7, 2021
66c4ff9
Merge remote-tracking branch 'upstream/main'
rhugonnet Nov 8, 2021
3044b37
Merge remote-tracking branch 'upstream/main'
rhugonnet Nov 22, 2021
fc957ea
Merge remote-tracking branch 'upstream/main'
rhugonnet Apr 11, 2022
d238a36
Merge remote-tracking branch 'upstream/main'
rhugonnet Jun 9, 2022
0d8e922
Merge remote-tracking branch 'upstream/main'
rhugonnet Aug 1, 2022
b17285e
Merge remote-tracking branch 'upstream/main'
rhugonnet Aug 9, 2022
e9dd8b2
Remove python 3.7 and add python 3.10 in CI and dependencies
rhugonnet Aug 9, 2022
4f6909a
Add python 3.10 and remove python 3.7
rhugonnet Aug 9, 2022
c752a00
Initialize nan arrays with np.full to avoid RuntimeError
rhugonnet Aug 9, 2022
97f9821
Correct np.empty into np.full
rhugonnet Aug 9, 2022
ac62527
Remove the dem dtype in np.full as terrain attribute output can be a …
rhugonnet Aug 9, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10"]


# Run all shells using bash (including Windows)
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sphinx:
formats: []

python:
version: 3.7
version: 3.8
install:
- requirements: dev-requirements.txt
- method: pip
Expand Down
2 changes: 1 addition & 1 deletion dev-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: xdem-dev
channels:
- conda-forge
dependencies:
- python>=3.7
- python>=3.8
- proj>=7.2
- geopandas
- numba
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: xdem
channels:
- conda-forge
dependencies:
- python>=3.7
- python>=3.8
- proj>=7.2
- geopandas
- numba
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"opencv": ["opencv"],
"pytransform3d": ["pytransform3d"],
},
python_requires=">=3.7",
python_requires=">=3.8",
scripts=[],
zip_safe=False,
)
Expand Down
4 changes: 2 additions & 2 deletions xdem/terrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _get_quadric_coefficients(
L = resolution

# Allocate the output.
output = np.empty((12,) + dem.shape, dtype=dem.dtype) + np.nan
rhugonnet marked this conversation as resolved.
Show resolved Hide resolved
output = np.full((12,) + dem.shape, fill_value=np.nan)

# Convert the string to a number (fewer bytes to compare each iteration)
if fill_method == "median":
Expand Down Expand Up @@ -337,7 +337,7 @@ def _get_windowed_indexes(
"""

# Allocate the outputs.
output = np.empty((5,) + dem.shape, dtype=dem.dtype) + np.nan
output = np.full((5,) + dem.shape, fill_value=np.nan)

# Half window size
hw = int(np.floor(window_size / 2))
Expand Down
6 changes: 3 additions & 3 deletions xdem/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def hypsometric_binning(ddem: np.ndarray, ref_dem: np.ndarray, bins: Union[float
# Calculate statistics for each bin.
# If no values exist, all stats should be nans (except count with should be 0)
# medians, means, stds, nmads = (np.zeros(shape=bins.shape[0] - 1, dtype=ddem.dtype) * np.nan, ) * 4
values = np.zeros(shape=zbins.shape[0] - 1, dtype=ddem.dtype) * np.nan
values = np.full(shape=zbins.shape[0] - 1, fill_value=np.nan, dtype=ddem.dtype)
counts = np.zeros_like(values, dtype=int)
for i in np.arange(indices.min(), indices.max() + 1):
values_in_bin = ddem[indices == i]
Expand Down Expand Up @@ -549,8 +549,8 @@ def get_regional_hypsometric_signal(ddem: Union[np.ndarray, np.ma.masked_array],
unique_indices = np.unique(glacier_index_map)

# Create empty (ddem) value and (pixel) count arrays which will be filled iteratively.
values = np.empty((n_bins, unique_indices.shape[0]), dtype=float) * np.nan
counts = np.empty((n_bins, unique_indices.shape[0]), dtype=float) * np.nan
values = np.full((n_bins, unique_indices.shape[0]), fill_value=np.nan, dtype=float)
counts = np.full((n_bins, unique_indices.shape[0]), fill_value=np.nan, dtype=float)

# Start a counter of glaciers that are actually processed.
count = 0
Expand Down