Commit 186038e3 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added URL checker and corresponding CI job. Fixed dead links. Updated...


Added URL checker and corresponding CI job. Fixed dead links. Updated installation procedure documentation.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 57f92a1b
Pipeline #16758 passed with stages
in 1 minute and 32 seconds
...@@ -41,6 +41,15 @@ test_styles: ...@@ -41,6 +41,15 @@ test_styles:
when: always when: always
test_urls:
stage: test
script:
- source /root/miniconda3/bin/activate ci_env
- pip install -U urlchecker
- make urlcheck
when: always
test_sensormapgeo_install: test_sensormapgeo_install:
stage: test stage: test
script: script:
......
...@@ -15,7 +15,7 @@ Types of Contributions ...@@ -15,7 +15,7 @@ Types of Contributions
Report Bugs Report Bugs
~~~~~~~~~~~ ~~~~~~~~~~~
Report bugs at https://github.com/danschef/sensormapgeo/issues. Report bugs at https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/-/issues
If you are reporting a bug, please include: If you are reporting a bug, please include:
...@@ -45,7 +45,7 @@ articles, and such. ...@@ -45,7 +45,7 @@ articles, and such.
Submit Feedback Submit Feedback
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
The best way to send feedback is to file an issue at https://github.com/danschef/sensormapgeo/issues. The best way to send feedback is to file an issue at https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/-/issues.
If you are proposing a feature: If you are proposing a feature:
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
History History
======= =======
0.4.7 (coming soon) 0.4.7 (2020-12-10)
------------------- ------------------
* Use 'conda activate' instead of deprecated 'source activate'. * Use 'conda activate' instead of deprecated 'source activate'.
* Added URL checker and corresponding CI job.
* Fixed dead links.
* Updated installation procedure documentation.
0.4.6 (2020-10-12) 0.4.6 (2020-10-12)
......
...@@ -55,6 +55,9 @@ lint: ## check style with flake8 ...@@ -55,6 +55,9 @@ lint: ## check style with flake8
pycodestyle sensormapgeo --exclude="*.ipynb,*.ipynb*" --max-line-length=120 > ./tests/linting/pycodestyle.log pycodestyle sensormapgeo --exclude="*.ipynb,*.ipynb*" --max-line-length=120 > ./tests/linting/pycodestyle.log
-pydocstyle sensormapgeo > ./tests/linting/pydocstyle.log -pydocstyle sensormapgeo > ./tests/linting/pydocstyle.log
urlcheck: ## check for dead URLs
urlchecker check . --file-types .py,.rst,.md,.json
test: ## run tests quickly with the default Python test: ## run tests quickly with the default Python
python setup.py test python setup.py test
......
...@@ -23,14 +23,6 @@ Status ...@@ -23,14 +23,6 @@ Status
:target: https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/blob/master/LICENSE :target: https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/blob/master/LICENSE
.. image:: https://img.shields.io/pypi/pyversions/sensormapgeo.svg .. image:: https://img.shields.io/pypi/pyversions/sensormapgeo.svg
:target: https://img.shields.io/pypi/pyversions/sensormapgeo.svg :target: https://img.shields.io/pypi/pyversions/sensormapgeo.svg
.. .. image:: https://img.shields.io/travis/EnMAP/sensormapgeo.svg
:target: https://travis-ci.org/EnMAP/sensormapgeo
.. .. image:: https://readthedocs.org/projects/sensormapgeo/badge/?version=latest
:target: https://sensormapgeo.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. .. image:: https://pyup.io/repos/github/EnMAP/sensormapgeo/shield.svg
:target: https://pyup.io/repos/github/EnMAP/sensormapgeo/
:alt: Updates
See also the latest coverage_ report and the nosetests_ HTML report. See also the latest coverage_ report and the nosetests_ HTML report.
......
.. highlight:: shell .. _installation:
============ ============
Installation Installation
============ ============
Stable release Using Anaconda or Miniconda (recommended)
-------------- -----------------------------------------
To install sensormapgeo, run this command in your terminal: Using conda_ (latest version recommended), sensormapgeo is installed as follows:
.. code-block:: console
$ pip install sensormapgeo 1. Create virtual environment for sensormapgeo (optional but recommended):
This is the preferred method to install sensormapgeo, as it will always install the most recent stable release. .. code-block:: bash
If you don't have `pip`_ installed, this `Python installation guide`_ can guide $ conda create -c conda-forge --name sensormapgeo python=3
you through the process. $ conda activate sensormapgeo
.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
2. Then install sensormapgeo itself:
From sources .. code-block:: bash
------------
The sources for sensormapgeo can be downloaded from the `Github repo`_. $ conda install -c conda-forge sensormapgeo
You can either clone the public repository:
.. code-block:: console This is the preferred method to install sensormapgeo, as it always installs the most recent stable release and
automatically resolves all the dependencies.
$ git clone git://github.com/danschef/sensormapgeo
Or download the `tarball`_: Using pip (not recommended)
---------------------------
.. code-block:: console There is also a `pip`_ installer for sensormapgeo. However, please note that sensormapgeo depends on some
open source packages that may cause problems when installed with pip. Therefore, we strongly recommend
to resolve the following dependencies before the pip installer is run:
$ curl -OJL https://github.com/danschef/sensormapgeo/tarball/master
Once you have a copy of the source, you can install it with: * _openmp_mutex=*=*llvm*
* geopandas
* gdal
* lxml
* numpy
* pyproj
* pyqt
* pyresample
* scikit-image
.. code-block:: console
$ python setup.py install Then, the pip installer can be run by:
.. code-block:: bash
.. _Github repo: https://github.com/danschef/sensormapgeo $ pip install sensormapgeo
.. _tarball: https://github.com/danschef/sensormapgeo/tarball/master
If you don't have `pip`_ installed, this `Python installation guide`_ can guide
you through the process.
.. note::
sensormapgeo has been tested with Python 3.6+.,
i.e., should be fully compatible to all Python versions from 3.6 onwards.
.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
.. _conda: https://conda.io/docs
...@@ -164,9 +164,9 @@ class SensorMapGeometryTransformer(object): ...@@ -164,9 +164,9 @@ class SensorMapGeometryTransformer(object):
out_res = (area_definition.pixel_size_x, area_definition.pixel_size_y) out_res = (area_definition.pixel_size_x, area_definition.pixel_size_y)
if tgt_res and tgt_res != out_res: if tgt_res and tgt_res != out_res:
warnings.warn('With respect to the Lon/Lat arrays the pixel size was set to %s instead of the desired ' warnings.warn(f'With respect to the Lon/Lat arrays the pixel size was set to {str(out_res)} instead of '
'%s. Provide a target extent where the coordinates are multiples of the pixel sizes to ' f'the desired {str(tgt_res)}. Provide a target extent where the coordinates are '
'avoid this.' % (str(out_res), str(tgt_res)), UserWarning) f'multiples of the pixel sizes to avoid this.', UserWarning)
else: else:
def raiseErr_if_empty(gdal_ds): def raiseErr_if_empty(gdal_ds):
...@@ -218,19 +218,17 @@ class SensorMapGeometryTransformer(object): ...@@ -218,19 +218,17 @@ class SensorMapGeometryTransformer(object):
vrt.FlushCache() vrt.FlushCache()
del ds_data, vrt del ds_data, vrt
subcall_with_output("gdalwarp '%s' '%s' " subcall_with_output(f"gdalwarp '{path_datavrt}' '{path_data_out}' "
'-geoloc ' f'-geoloc '
'-t_srs EPSG:%d ' f'-t_srs EPSG:{tgt_epsg} '
'-srcnodata 0 ' f'-srcnodata 0 '
'-r near ' f'-r near '
'-of ENVI ' f'-of ENVI '
'-dstnodata none ' f'-dstnodata none '
'-et 0 ' f'-et 0 '
'-overwrite ' f'-overwrite '
'-te %s ' f'-te {" ".join([str(i) for i in tgt_extent])} '
'%s' % (path_datavrt, path_data_out, tgt_epsg, f'{f"-tr {tgt_res[0]} {tgt_res[1]}" if tgt_res else ""}',
' '.join([str(i) for i in tgt_extent]),
' -tr %s %s' % tgt_res if tgt_res else '',),
v=True) v=True)
# get output X/Y size # get output X/Y size
...@@ -374,13 +372,12 @@ class SensorMapGeometryTransformer(object): ...@@ -374,13 +372,12 @@ class SensorMapGeometryTransformer(object):
# output validation # output validation
if not data_mapgeo.shape[:2] == (self.area_definition.height, self.area_definition.width): if not data_mapgeo.shape[:2] == (self.area_definition.height, self.area_definition.width):
raise RuntimeError('The computed map geometry output does not have the expected number of rows/columns. ' raise RuntimeError(f'The computed map geometry output does not have the expected number of rows/columns. '
'Expected: %s; output: %s.' f'Expected: {str((self.area_definition.height, self.area_definition.width))}; '
% (str((self.area_definition.height, self.area_definition.width)), f'output: {str(data_mapgeo.shape[:2])}.')
str(data_mapgeo.shape[:2])))
if data.ndim > 2 and data_mapgeo.ndim == 2: if data.ndim > 2 and data_mapgeo.ndim == 2:
raise RuntimeError('The computed map geometry output has only one band instead of the expected %d bands.' raise RuntimeError(f'The computed map geometry output has only one band '
% data.shape[2]) f'instead of the expected {data.shape[2]} bands.')
return data_mapgeo, out_gt, out_prj return data_mapgeo, out_gt, out_prj
...@@ -402,13 +399,13 @@ class SensorMapGeometryTransformer(object): ...@@ -402,13 +399,13 @@ class SensorMapGeometryTransformer(object):
# output validation # output validation
if not data_sensorgeo.shape[:2] == self.lats.shape[:2]: if not data_sensorgeo.shape[:2] == self.lats.shape[:2]:
raise RuntimeError('The computed sensor geometry output does not have the same X/Y dimension like the ' raise RuntimeError(f'The computed sensor geometry output does not have '
'coordinates array. Coordinates array: %s; output array: %s.' f'the same X/Y dimension like the coordinates array. '
% (self.lats.shape, data_sensorgeo.shape)) f'Coordinates array: {self.lats.shape}; output array: {data_sensorgeo.shape}.')
if data.ndim > 2 and data_sensorgeo.ndim == 2: if data.ndim > 2 and data_sensorgeo.ndim == 2:
raise RuntimeError('The computed sensor geometry output has only one band instead of the expected %d bands.' raise RuntimeError(f'The computed sensor geometry output has only one band '
% data.shape[2]) f'instead of the expected {data.shape[2]} bands.')
return data_sensorgeo return data_sensorgeo
......
...@@ -22,6 +22,6 @@ ...@@ -22,6 +22,6 @@
# You should have received a copy of the GNU Lesser General Public License along # You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.4.6' __version__ = '0.4.7'
__versionalias__ = '20201012.01' __versionalias__ = '20201210.01'
__author__ = 'Daniel Scheffler' __author__ = 'Daniel Scheffler'
...@@ -41,7 +41,7 @@ requirements = ['numpy', 'gdal', 'pyresample>=1.11.0', 'py_tools_ds>=0.14.26', ' ...@@ -41,7 +41,7 @@ requirements = ['numpy', 'gdal', 'pyresample>=1.11.0', 'py_tools_ds>=0.14.26', '
setup_requirements = [] setup_requirements = []
test_requirements = ['coverage', 'nose', 'nose-htmloutput', 'rednose'] test_requirements = ['coverage', 'nose', 'nose-htmloutput', 'rednose', 'urlchecker']
setup( setup(
author="Daniel Scheffler", author="Daniel Scheffler",
......
...@@ -6,30 +6,24 @@ channels: &id1 ...@@ -6,30 +6,24 @@ channels: &id1
dependencies: dependencies:
- python=3.*.* - python=3.*.*
- pip # avoids that conda uses the wrong pip - pip # avoids that conda uses the wrong pip
- numpy
- gdal
- pyresample>=1.11.0
- _openmp_mutex=*=*llvm* [Unix] # fixes a deadlock (https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/-/issues/6) - _openmp_mutex=*=*llvm* [Unix] # fixes a deadlock (https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/-/issues/6)
- gdal
- numpy
- py_tools_ds>=0.14.26
- pyproj>=2.2 - pyproj>=2.2
- pyresample>=1.11.0
# py_tools_ds
- pyqt
- scikit-image
- lxml
- geopandas
- ipython
- pip: - pip:
- py_tools_ds>=0.14.26
- pebble - pebble
- sphinx-argparse - coverage
- flake8 - flake8
- pycodestyle
- pylint
- pydocstyle
- nose - nose
- nose2 - nose2
- nose-htmloutput - nose-htmloutput
- coverage - pycodestyle
- pydocstyle
- pylint
- rednose - rednose
- sphinx-argparse
- urlchecker
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment