From 217121428cb6ceb6bd7150b530b5cd222a8d3f64 Mon Sep 17 00:00:00 2001 From: "Chris (Caihao) Cui" Date: Sun, 16 Jan 2022 22:47:10 +1100 Subject: [PATCH] make pkg work with python 3.7 --- .github/workflows/python-app.yml | 8 +++++--- Makefile | 2 +- README.md | 5 +++++ requirements.txt | 2 +- setup.py | 2 +- src/splitraster/io.py | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index f8730c6..e0ad754 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -8,17 +8,19 @@ on: branches: [master] pull_request: branches: [master] - jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9"] steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8.10 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: 3.8.10 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/Makefile b/Makefile index 723869c..7b43e9e 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ create_environment: ifeq (True,$(HAS_CONDA)) @echo ">>> Detected conda, creating conda environment." ifeq (3,$(findstring 3,$(PYTHON_INTERPRETER))) - conda create --name $(PROJECT_NAME) python=3 + conda create --name $(PROJECT_NAME) python=3.8 else conda create --name $(PROJECT_NAME) python=2.7 endif diff --git a/README.md b/README.md index 8c92f1d..236f6da 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ Provide good support for deep learning and computer vision tasks by creating a t Here is a sample image pairs, the size of RGB and GT are 1000-by-1000 large. The `SplitRaster` package successfully generate 16 256x256 images tiles with automatic padding on the edges. You can adjust the tile size and the overlap of the tiles for your own applications. + +## Update Log +- 2022-Jan-16 Fix bugs to make package suitable for python 3.7. Publish new version at(https://pypi.org/project/splitraster/0.3.2/) . + + ![Sample Image](docs/split_raster_sample.png) ## Use the packages diff --git a/requirements.txt b/requirements.txt index b7f5f6b..3d3391f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,4 +14,4 @@ # GDAL==3.3.1 # tqdm>=4.40.0 # scikit-image>=0.18.0 -splitraster==0.3.1 +splitraster==0.3.2 diff --git a/setup.py b/setup.py index c1239b6..931eb15 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from pathlib import Path setup( name='splitraster', - version='0.3.1', + version='0.3.2', author='Chris Cui', author_email='', description='Provide good support for deep learning and computer vision tasks by creating a tiled output from an input raster dataset.', diff --git a/src/splitraster/io.py b/src/splitraster/io.py index e5f86d8..fb9c5c0 100644 --- a/src/splitraster/io.py +++ b/src/splitraster/io.py @@ -82,7 +82,7 @@ def split_image(img_path, save_path, crop_size, repetition_rate=0, overwrite=Tru print(f"Input Image File Shape (H, W, D):{ img.shape}") stride = int(crop_size*(1-repetition_rate)) - print(f"{crop_size=}, {stride=}") + print(f"crop_size = {crop_size}, stride = {stride}") padded_img = padding_image(img, stride) H = padded_img.shape[0]