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:
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:
stage: test
script:
......
......@@ -15,7 +15,7 @@ Types of Contributions
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:
......@@ -45,7 +45,7 @@ articles, and such.
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:
......
......@@ -2,10 +2,13 @@
History
=======
0.4.7 (coming soon)
-------------------
0.4.7 (2020-12-10)
------------------
* 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)
......
......@@ -55,6 +55,9 @@ lint: ## check style with flake8
pycodestyle sensormapgeo --exclude="*.ipynb,*.ipynb*" --max-line-length=120 > ./tests/linting/pycodestyle.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
python setup.py test
......
......@@ -23,14 +23,6 @@ Status
:target: https://gitext.gfz-potsdam.de/EnMAP/sensormapgeo/blob/master/LICENSE
.. image:: 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.
......
.. highlight:: shell
.. _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
you through the process.
$ conda create -c conda-forge --name sensormapgeo python=3
$ 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
.. _tarball: https://github.com/danschef/sensormapgeo/tarball/master
$ pip install sensormapgeo
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):
out_res = (area_definition.pixel_size_x, area_definition.pixel_size_y)
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 '
'%s. Provide a target extent where the coordinates are multiples of the pixel sizes to '
'avoid this.' % (str(out_res), str(tgt_res)), UserWarning)
warnings.warn(f'With respect to the Lon/Lat arrays the pixel size was set to {str(out_res)} instead of '
f'the desired {str(tgt_res)}. Provide a target extent where the coordinates are '
f'multiples of the pixel sizes to avoid this.', UserWarning)
else:
def raiseErr_if_empty(gdal_ds):
......@@ -218,19 +218,17 @@ class SensorMapGeometryTransformer(object):
vrt.FlushCache()
del ds_data, vrt
subcall_with_output("gdalwarp '%s' '%s' "
'-geoloc '
'-t_srs EPSG:%d '
'-srcnodata 0 '
'-r near '
'-of ENVI '
'-dstnodata none '
'-et 0 '
'-overwrite '
'-te %s '
'%s' % (path_datavrt, path_data_out, tgt_epsg,
' '.join([str(i) for i in tgt_extent]),
' -tr %s %s' % tgt_res if tgt_res else '',),
subcall_with_output(f"gdalwarp '{path_datavrt}' '{path_data_out}' "
f'-geoloc '
f'-t_srs EPSG:{tgt_epsg} '
f'-srcnodata 0 '
f'-r near '
f'-of ENVI '
f'-dstnodata none '
f'-et 0 '
f'-overwrite '
f'-te {" ".join([str(i) for i in tgt_extent])} '
f'{f"-tr {tgt_res[0]} {tgt_res[1]}" if tgt_res else ""}',
v=True)
# get output X/Y size
......@@ -374,13 +372,12 @@ class SensorMapGeometryTransformer(object):
# output validation
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. '
'Expected: %s; output: %s.'
% (str((self.area_definition.height, self.area_definition.width)),
str(data_mapgeo.shape[:2])))
raise RuntimeError(f'The computed map geometry output does not have the expected number of rows/columns. '
f'Expected: {str((self.area_definition.height, self.area_definition.width))}; '
f'output: {str(data_mapgeo.shape[: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.'
% data.shape[2])
raise RuntimeError(f'The computed map geometry output has only one band '
f'instead of the expected {data.shape[2]} bands.')
return data_mapgeo, out_gt, out_prj
......@@ -402,13 +399,13 @@ class SensorMapGeometryTransformer(object):
# output validation
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 '
'coordinates array. Coordinates array: %s; output array: %s.'
% (self.lats.shape, data_sensorgeo.shape))
raise RuntimeError(f'The computed sensor geometry output does not have '
f'the same X/Y dimension like the coordinates array. '
f'Coordinates array: {self.lats.shape}; output array: {data_sensorgeo.shape}.')
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.'
% data.shape[2])
raise RuntimeError(f'The computed sensor geometry output has only one band '
f'instead of the expected {data.shape[2]} bands.')
return data_sensorgeo
......
......@@ -22,6 +22,6 @@
# 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/>.
__version__ = '0.4.6'
__versionalias__ = '20201012.01'
__version__ = '0.4.7'
__versionalias__ = '20201210.01'
__author__ = 'Daniel Scheffler'
......@@ -41,7 +41,7 @@ requirements = ['numpy', 'gdal', 'pyresample>=1.11.0', 'py_tools_ds>=0.14.26', '
setup_requirements = []
test_requirements = ['coverage', 'nose', 'nose-htmloutput', 'rednose']
test_requirements = ['coverage', 'nose', 'nose-htmloutput', 'rednose', 'urlchecker']
setup(
author="Daniel Scheffler",
......
......@@ -6,30 +6,24 @@ channels: &id1
dependencies:
- python=3.*.*
- 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)
- gdal
- numpy
- py_tools_ds>=0.14.26
- pyproj>=2.2
# py_tools_ds
- pyqt
- scikit-image
- lxml
- geopandas
- ipython
- pyresample>=1.11.0
- pip:
- py_tools_ds>=0.14.26
- pebble
- sphinx-argparse
- coverage
- flake8
- pycodestyle
- pylint
- pydocstyle
- nose
- nose2
- nose-htmloutput
- coverage
- pycodestyle
- pydocstyle
- pylint
- 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