[Git][debian-gis-team/python-geotiepoints][upstream] New upstream version 1.2.1
Antonio Valentino
gitlab at salsa.debian.org
Sun Mar 21 11:26:11 GMT 2021
Antonio Valentino pushed to branch upstream at Debian GIS Project / python-geotiepoints
Commits:
1eaf1f77 by Antonio Valentino at 2021-03-21T09:06:55+00:00
New upstream version 1.2.1
- - - - -
26 changed files:
- + .github/workflows/ci.yaml
- + .github/workflows/deploy.yaml
- .gitignore
- − .travis.yml
- CHANGELOG.md
- MANIFEST.in
- README.md
- RELEASING.md
- − appveyor.yml
- + continuous_integration/build-manylinux-wheels.sh
- + continuous_integration/environment.yaml
- doc/source/conf.py
- doc/source/index.rst
- − geotiepoints/multilinear_cython.c
- geotiepoints/tests/__init__.py
- geotiepoints/tests/test_geointerpolator.py
- geotiepoints/tests/test_interpolator.py
- geotiepoints/tests/test_modis.py
- geotiepoints/tests/test_modisinterpolator.py
- geotiepoints/tests/test_multilinear.py
- geotiepoints/tests/test_satelliteinterpolator.py
- geotiepoints/tests/test_viiinterpolator.py
- geotiepoints/version.py
- + pyproject.toml
- setup.cfg
- setup.py
Changes:
=====================================
.github/workflows/ci.yaml
=====================================
@@ -0,0 +1,97 @@
+name: CI
+
+on: [push, pull_request]
+
+jobs:
+ test:
+ runs-on: ${{ matrix.os }}
+ continue-on-error: ${{ matrix.experimental }}
+ strategy:
+ fail-fast: true
+ matrix:
+ os: ["windows-latest", "ubuntu-latest", "macos-latest"]
+ python-version: ["3.7", "3.8"]
+ experimental: [false]
+ include:
+ - python-version: "3.8"
+ os: "ubuntu-latest"
+ experimental: true
+
+ env:
+ PYTHON_VERSION: ${{ matrix.python-version }}
+ OS: ${{ matrix.os }}
+ UNSTABLE: ${{ matrix.experimental }}
+ ACTIONS_ALLOW_UNSECURE_COMMANDS: true
+
+ steps:
+ - name: Checkout source
+ uses: actions/checkout at v2
+
+ - name: Setup Conda Environment
+ uses: conda-incubator/setup-miniconda at v2
+ with:
+ miniconda-version: "latest"
+ python-version: ${{ matrix.python-version }}
+ mamba-version: "*"
+ channels: conda-forge,defaults
+ environment-file: continuous_integration/environment.yaml
+ activate-environment: test-environment
+
+ - name: Install unstable dependencies
+ if: matrix.experimental == true
+ shell: bash -l {0}
+ run: |
+ python -m pip install \
+ -f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
+ --no-deps --pre --upgrade \
+ matplotlib \
+ numpy \
+ pandas \
+ scipy; \
+ python -m pip install \
+ --no-deps --upgrade \
+ git+https://github.com/dask/dask \
+ git+https://github.com/dask/distributed \
+ git+https://github.com/zarr-developers/zarr \
+ git+https://github.com/pydata/bottleneck \
+ git+https://github.com/pydata/xarray;
+
+ - name: Install geotiepoints
+ shell: bash -l {0}
+ run: |
+ pip install -e .
+
+ - name: Run unit tests
+ shell: bash -l {0}
+ run: |
+ pytest --cov=geotiepoints geotiepoints/tests --cov-report=xml --cov-report=
+
+ # FIXME: These fail
+# - name: Test website
+# shell: bash -l {0}
+# run: |
+# cd doc && mkdir doctest && sphinx-build -E -n -b doctest ./source ./doctest && cd ..
+
+ - name: Upload unittest coverage to Codecov
+ uses: codecov/codecov-action at v1
+ with:
+ flags: unittests
+ file: ./coverage.xml
+ env_vars: OS,PYTHON_VERSION,UNSTABLE
+
+ - name: Coveralls Parallel
+ uses: AndreMiras/coveralls-python-action at develop
+ with:
+ flag-name: run-${{ matrix.test_number }}
+ parallel: true
+ if: runner.os == 'Linux'
+
+ coveralls:
+ needs: [test]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Coveralls Finished
+ uses: AndreMiras/coveralls-python-action at develop
+ with:
+ parallel-finished: true
+
=====================================
.github/workflows/deploy.yaml
=====================================
@@ -0,0 +1,127 @@
+name: Deploy sdist and wheels
+
+on:
+ push:
+ tags:
+ - v*
+ release:
+ types:
+ - published
+
+jobs:
+ build_sdist:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source
+ uses: actions/checkout at v2
+
+ - name: Create sdist
+ shell: bash -l {0}
+ run: |
+ pip install -q build
+ python -m build -s
+
+ - name: Upload sdist to build artifacts
+ uses: actions/upload-artifact at v2
+ with:
+ name: sdist
+ path: dist/*.tar.gz
+
+
+ build_wheels:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [windows-latest, macos-latest]
+ python-version: [3.6, 3.7, 3.8, 3.9]
+ include:
+ # Using pythons inside a docker image to provide all the Linux
+ # python-versions permutations.
+ - name: manylinux 64-bit
+ os: ubuntu-latest
+ python-version: 3.8
+ docker-image: manylinux1_x86_64
+ - name: manylinux 32-bit
+ os: ubuntu-latest
+ python-version: 3.8
+ docker-image: manylinux1_i686
+
+ steps:
+ - uses: actions/checkout at v2
+ - run: |
+ git fetch --prune --unshallow
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python at v1
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Install dependencies
+ run: |
+ python -m pip install -U -q pip Cython wheel setuptools twine numpy build
+
+ - name: Build and install macOS/Windows wheel
+ if: matrix.os != 'ubuntu-latest'
+ # see https://setuptools.readthedocs.io/en/latest/build_meta.html
+ run: |
+ python -m build
+ pip install --find-links=./dist/ python-geotiepoints
+
+ - name: Build Linux wheels inside docker
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ docker run \
+ -e PLAT=${{ matrix.docker-image }} \
+ -e USE_OMP=1 \
+ -v `pwd`:/io \
+ quay.io/pypa/${{ matrix.docker-image }} \
+ /io/continuous_integration/build-manylinux-wheels.sh
+
+ - name: Upload wheel(s) as build artifacts
+ uses: actions/upload-artifact at v2
+ with:
+ name: wheels
+ path: dist/*.whl
+
+ upload_test_pypi:
+ needs: [build_sdist, build_wheels]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Download sdist artifact
+ uses: actions/download-artifact at v2
+ with:
+ name: sdist
+ path: dist
+ - name: Download wheels artifact
+ uses: actions/download-artifact at v2
+ with:
+ name: wheels
+ path: dist
+ - name: Publish package to PyPI
+ uses: pypa/gh-action-pypi-publish at v1.4.1
+ with:
+ user: __token__
+ password: ${{ secrets.test_pypi_password }}
+ repository_url: https://test.pypi.org/legacy/
+
+ upload_pypi:
+ needs: [build_sdist, build_wheels]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Download sdist artifact
+ uses: actions/download-artifact at v2
+ with:
+ name: sdist
+ path: dist
+ - name: Download wheels artifact
+ uses: actions/download-artifact at v2
+ with:
+ name: wheels
+ path: dist
+ - name: Publish package to PyPI
+ if: github.event.action == 'published'
+ uses: pypa/gh-action-pypi-publish at v1.4.1
+ with:
+ user: __token__
+ password: ${{ secrets.pypi_password }}
=====================================
.gitignore
=====================================
@@ -25,3 +25,6 @@ pip-log.txt
#Mr Developer
.mr.developer.cfg
+
+# Don't include the C files in the repository
+geotiepoints/*.c
=====================================
.travis.yml deleted
=====================================
@@ -1,42 +0,0 @@
-language: python
-env:
- global:
- - PYTHON_VERSION=$PYTHON_VERSION
- - MAIN_CMD='python setup.py'
- - CONDA_DEPENDENCIES='cython pandas scipy coveralls coverage h5py mock dask xarray'
- - PIP_DEPENDENCIES=''
- - SETUP_XVFB=False
- - EVENT_TYPE='push pull_request'
- - SETUP_CMD='test'
- - CONDA_CHANNELS='conda-forge'
-matrix:
- include:
- - env: PYTHON_VERSION=3.6
- os: linux
- - env: PYTHON_VERSION=3.6
- os: osx
- language: generic
- - env: PYTHON_VERSION=3.7
- os: linux
- - env: PYTHON_VERSION=3.7
- os: osx
- language: generic
-install:
-- git clone --depth 1 git://github.com/astropy/ci-helpers.git
-- source ci-helpers/travis/setup_conda.sh
-script:
-- coverage run --source=python-geotiepoints setup.py test
-after_success:
-- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then coveralls; fi
-deploy:
- - provider: pypi
- user: dhoese
- password:
- secure: cnWXKNEvy9ggNw11czp1aUtBsuwM0V3x8tNyvo7zR1Wl8ktarTU6jTvD7PKpAyFT05rRSgi2K+jrHqsu4Xbo1rJNBsvqlHee7wCihfZOXOkwXJM6yjaQsf6e1TwA+JR4Sw/G1VLzzWufUTnKjEKSTvAka+GSo02MzyO6y5FXzc0=
- distributions: sdist
- skip_existing: true
- on:
- tags: true
- repo: pytroll/python-geotiepoints
-notifications:
- slack: pytroll:BTiIJLKkWvlePXCYRew0rliC
=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,27 @@
+## Version 1.2.1 (2021/03/08)
+
+### Issues Closed
+
+* [Issue 29](https://github.com/pytroll/python-geotiepoints/issues/29) - C extension does not compile on py3.9 without re-cythonizing ([PR 30](https://github.com/pytroll/python-geotiepoints/pull/30))
+* [Issue 28](https://github.com/pytroll/python-geotiepoints/issues/28) - I'm trying to install pycups on mac os using the treminal, but I'm getting “building wheel for pycups (setup.py) … error”
+* [Issue 27](https://github.com/pytroll/python-geotiepoints/issues/27) - MNT: Stop using ci-helpers in appveyor.yml ([PR 30](https://github.com/pytroll/python-geotiepoints/pull/30))
+* [Issue 26](https://github.com/pytroll/python-geotiepoints/issues/26) - pip install pysbrl --no-binary=pysbrl gives error
+
+In this release 4 issues were closed.
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 30](https://github.com/pytroll/python-geotiepoints/pull/30) - Switch build system to require Cython and build extensions on install ([29](https://github.com/pytroll/python-geotiepoints/issues/29), [27](https://github.com/pytroll/python-geotiepoints/issues/27))
+
+#### Features added
+
+* [PR 30](https://github.com/pytroll/python-geotiepoints/pull/30) - Switch build system to require Cython and build extensions on install ([29](https://github.com/pytroll/python-geotiepoints/issues/29), [27](https://github.com/pytroll/python-geotiepoints/issues/27))
+
+In this release 2 pull requests were closed.
+
+
## Version 1.2.0 (2020/06/05)
=====================================
MANIFEST.in
=====================================
@@ -1,5 +1,5 @@
-include docs/Makefile
-recursive-include docs/source *
+include doc/Makefile
+recursive-include doc/source *
include LICENSE.txt
include geotiepoints/multilinear_cython.pyx
include versioneer.py
=====================================
README.md
=====================================
@@ -1,7 +1,7 @@
python-geotiepoints
===================
-[![Build Status](https://travis-ci.org/pytroll/python-geotiepoints.svg?branch=master)](https://travis-ci.org/pytroll/python-geotiepoints)
+[![Build Status](https://github.com/pytroll/python-geotiepoints/workflows/CI/badge.svg?branch=master)](https://github.com/pytroll/python-geotiepoints/actions?query=workflow%3A%22CI%22)
[![Coverage Status](https://coveralls.io/repos/github/pytroll/python-geotiepoints/badge.svg?branch=master)](https://coveralls.io/github/pytroll/python-geotiepoints?branch=master)
[![Code Health](https://landscape.io/github/pytroll/python-geotiepoints/master/landscape.svg?style=flat)](https://landscape.io/github/pytroll/python-geotiepoints/master)
=====================================
RELEASING.md
=====================================
@@ -2,27 +2,35 @@
prerequisites: `pip install loghub setuptools twine`
-
1. checkout master
2. pull from repo
3. run the unittests
4. run `loghub` and update the `CHANGELOG.md` file:
```
-loghub pytroll/python-geotiepoints -u <username> -st v1.1.6 -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes"
+loghub pytroll/python-geotiepoints --token $LOGHUB_GITHUB_TOKEN -st v0.8.0 -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes -plg backwards-incompatibility "Backward incompatible changes" -plg refactor "Refactoring"
```
+This uses a `LOGHUB_GITHUB_TOKEN` environment variable. This must be created
+on GitHub and it is recommended that you add it to your `.bashrc` or
+`.bash_profile` or equivalent.
+
Don't forget to commit!
5. Create a tag with the new version number, starting with a 'v', eg:
```
-git tag v0.22.45
+git tag -a v0.22.45 -m "Version 0.22.45"
```
See [semver.org](http://semver.org/) on how to write a version number.
-
-
6. push changes to github `git push --follow-tags`
-7. Verify travis tests passed and deployed sdist and wheel to PyPI
+7. Verify github action unittests passed.
+8. Create a "Release" on GitHub by going to
+ https://github.com/pytroll/python-geotiepoints/releases and clicking "Draft a new release".
+ On the next page enter the newly created tag in the "Tag version" field,
+ "Version X.Y.Z" in the "Release title" field, and paste the markdown from
+ the changelog (the portion under the version section header) in the
+ "Describe this release" box. Finally click "Publish release".
+9. Verify the GitHub actions for deployment succeed and the release is on PyPI.
=====================================
appveyor.yml deleted
=====================================
@@ -1,43 +0,0 @@
-environment:
- global:
- PYTHON: "C:\\conda"
- MINICONDA_VERSION: "latest"
- CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
- CONDA_DEPENDENCIES: "Cython pandas scipy numpy coveralls coverage h5py mock dask xarray"
- PIP_DEPENDENCIES: ""
- CONDA_CHANNELS: "conda-forge"
-
- matrix:
- - PYTHON: "C:\\Python36_64"
- PYTHON_VERSION: "3.6"
- PYTHON_ARCH: "64"
- NUMPY_VERSION: "stable"
- - PYTHON: "C:\\Python37_64"
- PYTHON_VERSION: "3.7"
- PYTHON_ARCH: "64"
- NUMPY_VERSION: "stable"
-
-install:
- - "git clone --depth 1 git://github.com/astropy/ci-helpers.git"
- - "powershell ci-helpers/appveyor/install-miniconda.ps1"
- - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- - "activate test"
-
-build: false # Not a C# project, build stuff at the test step instead.
-
-test_script:
- # Build the compiled extension and run the project tests
- - "%CMD_IN_ENV% python setup.py test"
-
-after_test:
- # If tests are successful, create a whl package for the project.
- - "%CMD_IN_ENV% python setup.py bdist_wheel bdist_wininst"
- - ps: "ls dist"
-
-artifacts:
- # Archive the generated wheel package in the ci.appveyor.com build report.
- - path: dist\*
-
-#on_success:
-# - TODO: upload the content of dist/*.whl to a public wheelhouse
-#
=====================================
continuous_integration/build-manylinux-wheels.sh
=====================================
@@ -0,0 +1,43 @@
+#!/bin/bash
+set -e -x
+
+# This is to be run by Docker inside a Docker image.
+# You can test it locally on a Linux machine by installing docker and running from this repo's root:
+# $ docker run -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/scripts/build-manylinux-wheels.sh
+
+# * The -e just defines an environment variable PLAT=[docker name] inside the
+# docker - auditwheel can't detect the docker name automatically.
+# * The -v gives a directory alias for passing files in and out of the docker
+# (/io is arbitrary). E.g the `setup.py` script would be accessed in the
+# docker via `/io/setup.py`.
+# * quay.io/pypa/manylinux1_x86_64 is the full docker image name. Docker
+# downloads it automatically.
+# * The last argument is a shell command that the Docker will execute.
+# Filenames must be from the Docker's perspective.
+
+# Wheels are initially generated as you would usually, but put in a temp
+# directory temp-wheels. The pip-cache is optional but can speed up local builds
+# having a real permanent pip-cache dir.
+mkdir -p /io/pip-cache
+mkdir -p /io/temp-wheels
+
+# Clean out any old existing wheels.
+find /io/temp-wheels/ -type f -delete
+
+# Iterate through available pythons.
+for PYBIN in /opt/python/cp*/bin; do
+ "${PYBIN}/pip" install -q -U setuptools wheel nose --cache-dir /io/pip-cache
+ # Run the following in root of this repo.
+ (cd /io/ && "${PYBIN}/pip" install -q .)
+ (cd /io/ && "${PYBIN}/python" -m build -w -o /io/temp-wheels)
+done
+
+"$PYBIN/pip" install -q auditwheel
+
+# Wheels aren't considered manylinux unless they have been through
+# auditwheel. Audited wheels go in /io/dist/.
+mkdir -p /io/dist/
+
+for whl in /io/temp-wheels/*.whl; do
+ auditwheel repair "$whl" --plat "$PLAT" -w /io/dist/
+done
=====================================
continuous_integration/environment.yaml
=====================================
@@ -0,0 +1,19 @@
+name: test-environment
+channels:
+ - conda-forge
+dependencies:
+ - xarray
+ - dask
+ - distributed
+ - toolz
+ - Cython
+ - sphinx
+ - pillow
+ - pyyaml
+ - coveralls
+ - coverage
+ - codecov
+ - scipy
+ - h5py
+ - pytest
+ - pytest-cov
=====================================
doc/source/conf.py
=====================================
@@ -11,8 +11,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
-from geotiepoints import __version__ # noqa
+import os
+import sys
+from geotiepoints import __version__
from datetime import datetime
# If extensions (or modules to document with autodoc) are in another directory,
@@ -23,7 +24,6 @@ sys.path.insert(0, os.path.abspath('../../'))
sys.path.insert(0, os.path.abspath('../../geotiepoints'))
-
class Mock(object):
def __init__(self, *args, **kwargs):
pass
@@ -35,15 +35,14 @@ class Mock(object):
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
- elif name[0] == name[0].upper():
+ if name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
- else:
- return Mock()
+ return Mock()
-MOCK_MODULES = ['numpy', 'scipy.interpolate', 'scipy', 'pyresample',
+MOCK_MODULES = ['numpy', 'scipy.interpolate', 'scipy',
'pyhdf.SD', 'pyhdf.error']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
@@ -75,7 +74,7 @@ master_doc = 'index'
# General information about the project.
project = u'python-geotiepoints'
-copyright = u'2012-%d, Pytroll Team' % datetime.utcnow().year
+copyright = u'2012-%d, Pytroll Team' % datetime.utcnow().year # noqa
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
=====================================
doc/source/index.rst
=====================================
@@ -1,8 +1,3 @@
-.. python-geotiepoints documentation master file, created by
- sphinx-quickstart on Tue May 15 10:12:57 2012.
- You can adapt this file completely to your liking, but it should at least
- contain the root `toctree` directive.
-
Python-geotiepoints
===================
@@ -20,29 +15,33 @@ The source code of the module can be found on the github_ page.
.. contents::
-Installation
-------------
-
-You can install the latest version of python-geotiepoints with easy_install::
-
- $> easy_install python-geotiepoints
+Installation - Pip
+------------------
-or pip::
+You can install the latest version of python-geotiepoints with pip::
- $> pip install python-geotiepoints
+ pip install python-geotiepoints
Alternatively, you can download the source code from github_::
- $> git clone git://github.com/adybbroe/python-geotiepoints.git
+ git clone git://github.com/adybbroe/python-geotiepoints.git
and then run::
- $> python setup.py install
+ pip install .
+
+Alternatively, to install the package in a "development" mode when you
+want to edit the source code and see the effects::
+
+ pip install -e .
-or, if you want to hack the package::
+Installation - Conda
+--------------------
- $> python setup.py develop
+The python-geotiepoints package is also available on conda-forge. To install
+into an existing conda environment run::
+ conda install -c conda-forge python-geotiepoints
Usage for longitude and latitude interpolation
----------------------------------------------
=====================================
geotiepoints/multilinear_cython.c deleted
=====================================
The diff for this file was not included because it is too large.
=====================================
geotiepoints/tests/__init__.py
=====================================
@@ -1,66 +1,17 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
# Copyright (c) 2017 Adam.Dybbroe
-
-# Author(s):
-
-# Adam.Dybbroe <a000680 at c20671.ad.smhi.se>
-
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""The tests package"""
-
-from geotiepoints import interpolator
-
-from geotiepoints.tests import (test_geointerpolator,
- test_modis,
- test_satelliteinterpolator,
- test_interpolator,
- test_multilinear,
- test_modisinterpolator)
-
-
-import sys
-if sys.version_info < (2, 7):
- import unittest2 as unittest
-else:
- import unittest
-
-import doctest
-import os
-TRAVIS = os.environ.get("TRAVIS", False)
-
-
-def suite():
- """The global test suite.
- """
- mysuite = unittest.TestSuite()
- if not TRAVIS:
- # Test sphinx documentation pages:
- mysuite.addTests(doctest.DocFileSuite('../../doc/source/index.rst'))
- # # Test the documentation strings
- mysuite.addTests(doctest.DocTestSuite(interpolator))
-
- # Use the unittests also
- mysuite.addTests(test_geointerpolator.suite())
- mysuite.addTests(test_modis.suite())
- mysuite.addTests(test_satelliteinterpolator.suite())
- mysuite.addTests(test_interpolator.suite())
- mysuite.addTests(test_multilinear.suite())
- mysuite.addTests(test_modisinterpolator.suite())
- return mysuite
-
-if __name__ == '__main__':
- unittest.TextTestRunner(verbosity=2).run(suite())
+"""The tests package."""
=====================================
geotiepoints/tests/test_geointerpolator.py
=====================================
@@ -1,27 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
-# Copyright (c) 2013, 2017 Martin Raspaud
-
-# Author(s):
-
-# Martin Raspaud <martin.raspaud at smhi.se>
-
+# Copyright (c) 2013-2021 Python-geotiepoints developers
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-"""
+"""Tests for GeoInterpolator."""
import unittest
@@ -190,15 +183,3 @@ class TestGeoInterpolator(unittest.TestCase):
TIES_EXP6)
np.testing.assert_allclose(satint.row_indices,
np.array([0, 2, 7, 9, 10, 12, 17, 19]) / 5.0)
-
-
-def suite():
- """The suite for GeoInterpolator"""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestGeoInterpolator))
-
- return mysuite
-
-if __name__ == '__main__':
- unittest.main()
=====================================
geotiepoints/tests/test_interpolator.py
=====================================
@@ -1,27 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
-# Copyright (c) 2013, 2017 Martin Raspaud
-
-# Author(s):
-
-# Martin Raspaud <martin.raspaud at smhi.se>
-
+# Copyright (c) 2013-2021 Python-geotiepoints developers
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-"""
+"""Tests for Interpolator."""
import unittest
import numpy as np
@@ -163,12 +156,3 @@ class TestInterpolator(unittest.TestCase):
# [3.4, 7.4, 11.4, 15.4, 19.4]])))
# self.assertTrue(np.allclose(satint.row_indices,
# np.array([0, 2, 7, 9, 10, 12, 17, 19])))
-
-
-def suite():
- """The suite for Interpolator"""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestInterpolator))
-
- return mysuite
=====================================
geotiepoints/tests/test_modis.py
=====================================
@@ -1,6 +1,20 @@
-"""
-Unit tests for python-geotiepoints: MODIS examples
-"""
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# Copyright (c) 2013-2021 Python-geotiepoints developers
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""Unit tests for python-geotiepoints: MODIS examples."""
import unittest
import numpy as np
@@ -85,16 +99,3 @@ class TestMODIS(unittest.TestCase):
self.assert_(np.allclose(tlons, glons, atol=0.05))
self.assert_(np.allclose(tlats, glats, atol=0.05))
-
-
-def suite():
- """The suite for MODIS"""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestUtils))
- mysuite.addTest(loader.loadTestsFromTestCase(TestMODIS))
-
- return mysuite
-
-if __name__ == "__main__":
- unittest.main()
=====================================
geotiepoints/tests/test_modisinterpolator.py
=====================================
@@ -1,24 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
-# Copyright (c) 2018 Martin Raspaud
-
-# Author(s):
-
-# Martin Raspaud <martin.raspaud at smhi.se>
-
+# Copyright (c) 2017-2021 Python-geotiepoints developers
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+"""Tests for MODIS interpolators."""
import unittest
import numpy as np
@@ -116,16 +112,3 @@ class TestModisInterpolator(unittest.TestCase):
lons = xr.where(lons > 180, lons - 360, lons)
self.assertTrue(np.allclose(orig_lon, lons, atol=1e-2))
self.assertTrue(np.allclose(lat1, lats, atol=1e-2))
-
-
-def suite():
- """The suite for MODIS"""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestModisInterpolator))
-
- return mysuite
-
-
-if __name__ == "__main__":
- unittest.main()
=====================================
geotiepoints/tests/test_multilinear.py
=====================================
@@ -1,27 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
-# Copyright (c) 2017 Adam.Dybbroe
-
-# Author(s):
-
-# Adam.Dybbroe <adam.dybbroe at smhi.se>
-
+# Copyright (c) 2017-2021 Python-geotiepoints developers
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""Test the multilinear interpolation Cython implementation
-"""
+"""Test the multilinear interpolation Cython implementation."""
import unittest
import numpy as np
=====================================
geotiepoints/tests/test_satelliteinterpolator.py
=====================================
@@ -1,27 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-
-# Copyright (c) 2013, 2017 Martin Raspaud
-
-# Author(s):
-
-# Martin Raspaud <martin.raspaud at smhi.se>
-
+# Copyright (c) 2013-2021 Python-geotiepoints developers
+#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
-
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-
+#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-"""
+"""Tests for SatelliteInterpolator."""
import unittest
import numpy as np
@@ -189,15 +182,3 @@ class TestSatelliteInterpolator(unittest.TestCase):
# self.assertTrue(np.allclose(satint.tie_data[0], TIES_EXP6))
# self.assertTrue(np.allclose(satint.row_indices,
# np.array([0, 2, 7, 9, 10, 12, 17, 19])))
-
-
-def suite():
- """The suite for Satellite Interpolator"""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestSatelliteInterpolator))
-
- return mysuite
-
-if __name__ == '__main__':
- unittest.main()
=====================================
geotiepoints/tests/test_viiinterpolator.py
=====================================
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (c) 2017-2020 Python-geotiepoints developers
+# Copyright (c) 2017-2021 Python-geotiepoints developers
#
# This file is part of python-geotiepoints.
#
@@ -15,14 +15,16 @@
#
# You should have received a copy of the GNU General Public License along with
# python-geotiepoints. If not, see <http://www.gnu.org/licenses/>.
-
"""Test of the interpolation of geographical tiepoints for the VII products.
+
It follows the description provided in document "EPS-SG VII Level 1B Product Format Specification".
+
"""
import unittest
import numpy as np
import xarray as xr
+import pytest
from geotiepoints.viiinterpolator import tie_points_interpolation, tie_points_geo_interpolation
@@ -192,12 +194,10 @@ class TestViiInterpolator(unittest.TestCase):
self.assertEqual(len(result_valid.coords), 0)
# Test the interpolation routine with invalid input
- with self.assertRaises(ValueError):
- tie_points_interpolation(
- [self.invalid_data_for_interpolation],
- TEST_SCAN_ALT_TIE_POINTS,
- TEST_TIE_POINTS_FACTOR
- )[0]
+ pytest.raises(ValueError, tie_points_interpolation,
+ [self.invalid_data_for_interpolation],
+ TEST_SCAN_ALT_TIE_POINTS,
+ TEST_TIE_POINTS_FACTOR)
def test_tie_points_geo_interpolation(self):
"""# Test the coordinates interpolation routine with valid and invalid input."""
@@ -237,16 +237,3 @@ class TestViiInterpolator(unittest.TestCase):
TEST_SCAN_ALT_TIE_POINTS,
TEST_TIE_POINTS_FACTOR
)
-
-
-def suite():
- """The suite for VII interpolator"""
- loader = unittest.TestLoader()
- mysuite = unittest.TestSuite()
- mysuite.addTest(loader.loadTestsFromTestCase(TestViiInterpolator))
-
- return mysuite
-
-
-if __name__ == "__main__":
- unittest.main()
=====================================
geotiepoints/version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (HEAD -> master, tag: v1.2.0)"
- git_full = "f28660ddfc898e07dc65bf5a031a5e8434aa3791"
- git_date = "2020-06-05 12:34:19 +0200"
+ git_refnames = " (HEAD -> master, tag: v1.2.1)"
+ git_full = "d083fad851b7dcbc0a397effff7b4623cc6099df"
+ git_date = "2021-03-08 11:02:19 +0100"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
=====================================
pyproject.toml
=====================================
@@ -0,0 +1,2 @@
+[build-system]
+requires = ["setuptools", "wheel", "oldest-supported-numpy", "Cython"]
\ No newline at end of file
=====================================
setup.cfg
=====================================
@@ -1,5 +1,5 @@
[bdist_rpm]
-requires=numpy scipy pyresample
+requires=numpy cython scipy
release=1
[flake8]
=====================================
setup.py
=====================================
@@ -24,16 +24,15 @@
"""Setting up the geo_interpolator project.
"""
-import os
import sys
from setuptools import Extension, setup
-from setuptools.command.build_ext import build_ext as _build_ext
import versioneer
+import numpy as np
+from Cython.Build import cythonize
-requirements = ['numpy', 'scipy', 'pandas'],
-# unittest2 is required by h5py 2.8.0rc:
-test_requires = ['h5py', 'unittest2', 'xarray', 'dask']
+requirements = ['numpy', 'scipy', 'pandas']
+test_requires = ['h5py', 'xarray', 'dask']
if sys.platform.startswith("win"):
extra_compile_args = []
@@ -44,77 +43,14 @@ EXTENSIONS = [
Extension(
'geotiepoints.multilinear_cython',
sources=['geotiepoints/multilinear_cython.pyx'],
- extra_compile_args=extra_compile_args
+ extra_compile_args=extra_compile_args,
+ include_dirs=[np.get_include()],
),
- Extension(
- 'geotiepoints.multilinear_cython',
- sources=['geotiepoints/multilinear_cython.pyx',
- 'geotiepoints/multilinear_cython.c'],
- language='c', extra_compile_args=extra_compile_args,
- depends=[]
- )
-
]
-try:
- from Cython.Build import cythonize
-except ImportError:
- cythonize = None
-
-
-def set_builtin(name, value):
- if isinstance(__builtins__, dict):
- __builtins__[name] = value
- else:
- setattr(__builtins__, name, value)
-
-
cmdclass = versioneer.get_cmdclass()
-versioneer_build_ext = cmdclass.get('build_ext', _build_ext)
-
-
-class build_ext(versioneer_build_ext):
-
- """Work around to bootstrap numpy includes in to extensions.
-
- Copied from:
-
- http://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py
-
- """
-
- def finalize_options(self):
- versioneer_build_ext.finalize_options(self)
- # Prevent numpy from thinking it is still in its setup process:
- set_builtin('__NUMPY_SETUP__', False)
- import numpy
- self.include_dirs.append(numpy.get_include())
-
-
-cmdclass['build_ext'] = build_ext
if __name__ == "__main__":
- if not os.getenv("USE_CYTHON", False) or cythonize is None:
- print(
- "Cython will not be used. Use environment variable 'USE_CYTHON=True' to use it")
-
- def cythonize(extensions, **dummy):
- """Fake function to compile from C/C++ files instead of compiling .pyx files with cython.
- """
- for extension in extensions:
- sources = []
- for sfile in extension.sources:
- path, ext = os.path.splitext(sfile)
- if ext in ('.pyx', '.py'):
- if extension.language == 'c++':
- ext = '.cpp'
- else:
- ext = '.c'
- sfile = path + ext
- sources.append(sfile)
- extension.sources[:] = sources
- return extensions
-
setup(name='python-geotiepoints',
version=versioneer.get_version(),
description='Interpolation of geographic tiepoints in Python',
@@ -130,13 +66,11 @@ if __name__ == "__main__":
url="https://github.com/pytroll/python-geotiepoints",
packages=['geotiepoints'],
# packages=find_packages(),
- setup_requires=['numpy'],
- python_requires='>=3.4',
+ setup_requires=['numpy', 'cython'],
+ python_requires='>=3.6',
cmdclass=cmdclass,
-
install_requires=requirements,
ext_modules=cythonize(EXTENSIONS),
-
test_suite='geotiepoints.tests.suite',
tests_require=test_requires,
zip_safe=False
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-geotiepoints/-/commit/1eaf1f770086554f9efd14ab33af415b3290c5f6
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-geotiepoints/-/commit/1eaf1f770086554f9efd14ab33af415b3290c5f6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210321/af4fa6cd/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list