Commit 1a25b2cc authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Fix for broken SSIM filtering. PEP8 editing. Added test_styles to...

Fix for broken SSIM filtering. PEP8 editing. Added test_styles to .gitlab-ci.yml. Combined deploy stages.
parent ba16de00
Pipeline #1160 failed with stages
in 7 minutes and 19 seconds
......@@ -12,8 +12,7 @@ variables:
stages:
- test
- deploy_pages
- deploy_to_pypi
- deploy
- cleanup
......@@ -34,6 +33,21 @@ test_arosics:
when: always
test_styles:
stage: test
script:
- source /root/anaconda3/bin/activate
- export GDAL_DATA=/root/anaconda3/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- make lint
artifacts:
paths:
- tests/linting/flake8.log
- tests/linting/pycodestyle.log
- tests/linting/pydocstyle.log
when: always
test_arosics_install:
stage: test
script:
......@@ -51,8 +65,8 @@ test_arosics_install:
- python -c "from arosics import COREG, COREG_LOCAL"
pages:
stage: deploy_pages
deploy_pages:
stage: deploy
dependencies:
- test_arosics
script:
......@@ -62,7 +76,6 @@ pages:
- cp nosetests.* public/nosetests_reports/
- mkdir -p public/doc
- cp -r docs/_build/html/* public/doc/
artifacts:
paths:
- public
......@@ -72,7 +85,7 @@ pages:
deploy_pypi:
stage: deploy_to_pypi
stage: deploy
dependencies:
- test_arosics
script: # Configure the PyPI credentials, then push the package, and cleanup the creds.
......
......@@ -570,7 +570,7 @@ class COREG(object):
autosize=False,
width=1000,
height=1000,
margin=dict(l=65, r=50, b=65, t=90))
margin={'l': 65, 'r': 50, 'b': 65, 't': 90})
fig = go.Figure(data=data, layout=layout)
return iplot(fig, filename='SCPS')
......
......@@ -411,25 +411,25 @@ class COREG_LOCAL(object):
if hide_filtered:
if self.tieP_filter_level > 0:
GDF = GDF[GDF.L1_OUTLIER == False].copy()
GDF = GDF[GDF.L1_OUTLIER.__eq__(False)].copy()
if self.tieP_filter_level > 1:
GDF = GDF[GDF.L2_OUTLIER == False].copy()
GDF = GDF[GDF.L2_OUTLIER.__eq__(False)].copy()
if self.tieP_filter_level > 2:
GDF = GDF[GDF.L3_OUTLIER == False].copy()
GDF = GDF[GDF.L3_OUTLIER.__eq__(False)].copy()
else:
marker = 'o' if len(GDF) < 10000 else '.'
if self.tieP_filter_level > 0:
# flag level 1 outliers
GDF_filt = GDF[GDF.L1_OUTLIER == True].copy()
GDF_filt = GDF[GDF.L1_OUTLIER.__eq__(True)].copy()
plt.scatter(GDF_filt['plt_X'], GDF_filt['plt_Y'], c='b', marker=marker, s=250, alpha=1.0,
label='reliability')
if self.tieP_filter_level > 1:
# flag level 2 outliers
GDF_filt = GDF[GDF.L2_OUTLIER == True].copy()
GDF_filt = GDF[GDF.L2_OUTLIER.__eq__(True)].copy()
plt.scatter(GDF_filt['plt_X'], GDF_filt['plt_Y'], c='r', marker=marker, s=150, alpha=1.0, label='MSSIM')
if self.tieP_filter_level > 2:
# flag level 3 outliers
GDF_filt = GDF[GDF.L3_OUTLIER == True].copy()
GDF_filt = GDF[GDF.L3_OUTLIER.__eq__(True)].copy()
plt.scatter(GDF_filt['plt_X'], GDF_filt['plt_Y'], c='y', marker=marker, s=250, alpha=1.0,
label='RANSAC')
......
......@@ -537,7 +537,7 @@ class Tie_Point_Grid(object):
else:
# exclude all points flagged as outliers
if 'OUTLIER' in GDF.columns:
GDF = GDF[GDF.OUTLIER == False].copy()
GDF = GDF[GDF.OUTLIER.__eq__(False)].copy()
avail_TP = len(GDF)
if not avail_TP:
......@@ -899,7 +899,7 @@ class Tie_Point_Refiner(object):
# self.GDF.SSIM_IMPROVED = \
# self.GDF.apply(lambda GDF_row: GDF_row['SSIM_AFTER']>GDF_row['SSIM_BEFORE'] + ssim_diff, axis=1)
return self.GDF.SSIM_IMPROVED is False
return ~self.GDF.SSIM_IMPROVED
def _RANSAC_outlier_detection(self, inGDF):
"""Detect geometric outliers between point cloud of source and estimated coordinates using RANSAC algorithm."""
......@@ -979,7 +979,7 @@ class Tie_Point_Refiner(object):
count_iter += 1
outliers = inliers == False if inliers is not None and inliers.size else np.array([])
outliers = inliers.__eq__(False) if inliers is not None and inliers.size else np.array([])
if inGDF.empty or outliers is None or (isinstance(outliers, list) and not outliers) or \
(isinstance(outliers, np.ndarray) and not outliers.size):
......
......@@ -63,7 +63,7 @@ def wfa(p, c):
try:
with open(p, 'a') as of:
of.write(c)
except:
except Exception:
pass
......
......@@ -2,7 +2,7 @@
import numpy as np
from matplotlib import pyplot as plt
# from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 # this is needed for fig.add_subplot(..., projection='3d')
def _norm(array, normto):
......
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