Commit 5c40567f authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fixed DeprecationWarning within CORE_LOCAL.view_CoRegPoints(). Caught...


Fixed DeprecationWarning within CORE_LOCAL.view_CoRegPoints(). Caught matplotlib warnings within tests. Added test/doc/lint/dev requirements as optional installation procedures to setup.py. Updated version info.
Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 6850e423
Pipeline #14473 failed with stages
in 1 minute and 52 seconds
......@@ -522,8 +522,7 @@ class COREG_LOCAL(object):
axes_class=plt.Axes # needed because ax is a GeoAxis instance
)
fig.add_axes(cax)
fig.colorbar(mappable, cax=cax, cmap=palette,
norm=Normalize(vmin=vmin, vmax=vmax), orientation="horizontal")
fig.colorbar(mappable, cax=cax, orientation="horizontal")
# hack to enlarge the figure on the top to avoid cutting off the title (everthing else has no effect)
divider.new_vertical(size="2%", pad=0.4, pack_start=False, axes_class=plt.Axes)
......
......@@ -22,5 +22,5 @@
# with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '1.0.1'
__versionalias__ = '2020-10-12_01'
__version__ = '1.0.2'
__versionalias__ = '2020-10-12_02'
......@@ -37,7 +37,7 @@ version = {}
with open("arosics/version.py") as version_file:
exec(version_file.read(), version)
requirements = [
req = [
'cmocean',
'folium>=0.6.0',
'gdal',
......@@ -56,28 +56,23 @@ requirements = [
'six',
]
setup_requirements = [
req_setup = [
'setuptools',
'setuptools-git'
]
test_requirements = requirements + ['coverage', 'nose', 'nose-htmloutput', 'rednose']
# ipython is needed for testing interactive plotting
req_test = ['coverage', 'nose', 'nose2', 'nose-htmloutput', 'rednose', 'ipython']
req_doc = ['sphinx-argparse', 'sphinx_rtd_theme']
req_lint = ['flake8', 'pycodestyle', 'pydocstyle']
req_dev = req_setup + req_test + req_doc + req_lint
setup(
name='arosics',
version=version['__version__'],
description="An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data",
long_description=readme + '\n\n' + history,
author="Daniel Scheffler",
author_email='daniel.scheffler@gfz-potsdam.de',
url='https://gitext.gfz-potsdam.de/danschef/arosics',
packages=find_packages(exclude=['tests*']),
include_package_data=True,
scripts=["bin/arosics_cli.py"],
install_requires=requirements,
license="GPL-3.0-or-later",
zip_safe=False,
keywords=['arosics', 'image co-registration', 'geometric pre-processing', 'remote sensing', 'sensor fusion'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
......@@ -92,7 +87,25 @@ setup(
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
description="An Automated and Robust Open-Source Image Co-Registration Software for Multi-Sensor Satellite Data",
extras_require={
"doc": req_doc,
"test": req_test,
"lint": req_lint,
"dev": req_dev
},
include_package_data=True,
install_requires=req,
keywords=['arosics', 'image co-registration', 'geometric pre-processing', 'remote sensing', 'sensor fusion'],
license="GPL-3.0-or-later",
long_description=readme + '\n\n' + history,
name='arosics',
packages=find_packages(exclude=['tests*']),
scripts=["bin/arosics_cli.py"],
setup_requires=req_setup,
test_suite='tests',
tests_require=test_requirements,
setup_requires=setup_requirements,
tests_require=req + req_test,
url='https://gitext.gfz-potsdam.de/danschef/arosics',
version=version['__version__'],
zip_safe=False,
)
......@@ -12,7 +12,7 @@ dependencies:
- pyproj>2.2.0
- geopandas
- pandas
- ipython
- ipython # needed to test interactive plotting
- shapely
- matplotlib
- holoviews
......
......@@ -28,6 +28,7 @@ import unittest
import shutil
import os
import numpy as np
import warnings
# custom
from .cases import test_cases
......@@ -181,10 +182,13 @@ class CompleteWorkflow_INTER1_S2A_S2A(unittest.TestCase):
# @unittest.SkipTest
def test_shift_calculation_verboseMode(self):
"""Test the verbose mode - runs the functions of the plotting submodule."""
CR = self.run_shift_detection_correction(self.ref_path, self.tgt_path,
**dict(self.coreg_kwargs, v=True))
self.assertTrue(CR.success)
with warnings.catch_warnings():
warnings.filterwarnings(
'ignore', category=UserWarning, message='Matplotlib is currently using agg, '
'which is a non-GUI backend, so cannot show the figure.')
CR = self.run_shift_detection_correction(self.ref_path, self.tgt_path,
**dict(self.coreg_kwargs, v=True))
self.assertTrue(CR.success)
def test_shift_calculation_windowCoveringNodata(self):
"""Test shift detection in case the given matching window (defined by 'wp' and 'ws' covers the nodata area
......@@ -289,15 +293,19 @@ class CompleteWorkflow_INTER1_S2A_S2A(unittest.TestCase):
self.assertTrue(CR.success)
# test all the visualization functions
CR.show_cross_power_spectrum()
CR.show_cross_power_spectrum(interactive=True)
CR.show_matchWin(interactive=False, after_correction=None)
CR.show_matchWin(interactive=False, after_correction=True)
CR.show_matchWin(interactive=False, after_correction=False)
CR.show_matchWin(interactive=True, after_correction=None) # only works if test is started with ipython
CR.show_matchWin(interactive=True, after_correction=True)
CR.show_matchWin(interactive=True, after_correction=False)
CR.show_image_footprints()
with warnings.catch_warnings():
warnings.filterwarnings(
'ignore', category=UserWarning, message='Matplotlib is currently using agg, '
'which is a non-GUI backend, so cannot show the figure.')
CR.show_cross_power_spectrum()
CR.show_cross_power_spectrum(interactive=True)
CR.show_matchWin(interactive=False, after_correction=None)
CR.show_matchWin(interactive=False, after_correction=True)
CR.show_matchWin(interactive=False, after_correction=False)
CR.show_matchWin(interactive=True, after_correction=None) # only works if test is started with ipython
CR.show_matchWin(interactive=True, after_correction=True)
CR.show_matchWin(interactive=True, after_correction=False)
CR.show_image_footprints()
# if __name__ == '__main__':
# unittest.main(argv=['first-arg-is-ignored'],exit=False, verbosity=2)
......@@ -27,6 +27,7 @@
import unittest
import shutil
import os
import warnings
# custom
from .cases import test_cases
......@@ -84,10 +85,14 @@ class CompleteWorkflow_INTER1_S2A_S2A(unittest.TestCase):
CRL.CoRegPoints_table
# test tie point grid visualization
CRL.view_CoRegPoints(hide_filtered=True)
CRL.view_CoRegPoints(hide_filtered=False)
CRL.view_CoRegPoints(shapes2plot='vectors')
CRL.view_CoRegPoints_folium()
with warnings.catch_warnings():
warnings.filterwarnings(
'ignore', category=UserWarning, message='Matplotlib is currently using agg, '
'which is a non-GUI backend, so cannot show the figure.')
CRL.view_CoRegPoints(hide_filtered=True)
CRL.view_CoRegPoints(hide_filtered=False)
CRL.view_CoRegPoints(shapes2plot='vectors')
CRL.view_CoRegPoints_folium()
# test shift correction and output writer
CRL.correct_shifts()
......
......@@ -29,6 +29,7 @@ import tempfile
import os
from pkgutil import find_loader
import shutil
import warnings
# custom
from .cases import test_cases
......@@ -78,7 +79,11 @@ class Test_Tie_Point_Grid(unittest.TestCase):
self.TPG.calc_overall_ssim(include_outliers=True, after_correction=False)
def test_plot_shift_distribution(self):
self.TPG.plot_shift_distribution()
with warnings.catch_warnings():
warnings.filterwarnings(
'ignore', category=UserWarning, message='Matplotlib is currently using agg, '
'which is a non-GUI backend, so cannot show the figure.')
self.TPG.plot_shift_distribution()
def test_dump_CoRegPoints_table(self):
with tempfile.TemporaryDirectory() as tmpdir:
......
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