Skip to content

Commit fc01b11

Browse files
Merge branch 'kassoulet-feature/display_csv_content_in_test_log' into develop
# Conflicts: # .github/workflows/ubuntu.yml # environment.yml # tests/end_to_end/ref_data/test_full/KLT_matcher_L2F_T12SYH_20220824T175017_LS9_R035_B04_10m_T12SYH_20220514T175909_B04.csv # tests/end_to_end/ref_data/test_full/kp_delta.json # tests/end_to_end/test_main.py
2 parents 1ee8fd4 + c2966e8 commit fc01b11

22 files changed

+77121
-54
lines changed

.github/workflows/code-quality.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
code-quality:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.12]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: 'pip'
24+
25+
- name: Install Conda
26+
uses: conda-incubator/setup-miniconda@v3
27+
with:
28+
activate-environment: karios
29+
python-version: ${{ matrix.python-version }}
30+
auto-activate-base: false
31+
32+
- name: Install dependencies
33+
run: |
34+
pip install -e .
35+
pip install -r requirements_dev.txt
36+
# Install tools needed for pre-commit checks
37+
pip install black isort bandit pydocstyle pre-commit
38+
39+
- name: Run license headers check
40+
run: |
41+
python -c "import licenseheaders; print('licenseheaders available')"
42+
# Check if license headers are properly applied
43+
python -m licenseheaders -cy -o "Telespazio France" -n "KARIOS" -t apache-2.tmpl -u "https://github.com/telespazio-tim/karios" -d karios --checkonly .
44+
continue-on-error: true
45+
46+
- name: Run import sorting check (isort)
47+
run: |
48+
isort --check-only .
49+
50+
- name: Run code formatting check (black)
51+
run: |
52+
black -l 100 --check .
53+
54+
- name: Run security check (bandit)
55+
run: |
56+
bandit .

.github/workflows/ubuntu.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,32 @@ jobs:
3737
environment-file: environment.yml
3838
activate-environment: karios
3939

40-
- name: Test conda installation
41-
shell: bash -l {0}
42-
run: conda info
43-
44-
# - name: Install dependencies manually using conda install
45-
# shell: bash -l {0}
46-
# run: |
47-
# conda install --yes \
48-
# numpy=1.26.* \
49-
# matplotlib-base=3.9.* \
50-
# gdal=3.8.1 \
51-
# opencv=4.8.1 \
52-
# pandas=2.1.4 \
53-
# python=3.12 \
54-
# scikit-image=0.22.0 \
55-
# rich-click=1.8.9
40+
- name: Install system dependencies
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y libglx0
5644
5745
- name: Install package in development mode
5846
shell: bash -l {0}
5947
run: |
6048
python -m pip install --upgrade pip
6149
pip install setuptools>=77.0
6250
pip install -e .
51+
shell: bash -l {0}
6352

6453
- name: Install dev dependencies for testing
6554
shell: bash -l {0}
6655
run: |
6756
pip install pytest
6857
if [ -f requirements_dev.txt ]; then
6958
pip install -r requirements_dev.txt
70-
7159
# conda install -n karios -c conda-forge --file requirements_dev.txt
7260
fi
61+
shell: bash -l {0}
7362

7463
- name: Run tests
7564
shell: bash -l {0}
7665
continue-on-error: true
7766
run: |
78-
python -m pytest tests/ -v
67+
python -m pytest tests/ -v
68+
shell: bash -l {0}

.github/workflows/windows64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ jobs:
5252
5353
- name: Run tests
5454
run: |
55-
python -m pytest tests/ -v
55+
python -m pytest tests/ -v

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ repos:
4646
require_serial: true
4747
pass_filenames: false # avoid files to be passed to pytest as args
4848
always_run: true
49-
stages: [push]
49+
stages: [pre-push]
5050
# - id: docstyle
5151
# name: docstyle
5252
# entry: pydocstyle --convention=google

environment.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ name: karios
22
channels:
33
- conda-forge
44
dependencies:
5-
# - python=3.11
65
- pip
7-
- numpy
8-
- matplotlib-base=3.9.*
9-
- gdal=3.8.1
10-
- opencv=4.8.1
11-
- pandas=2.1.4
6+
- gdal=3.8.*
7+
- matplotlib-base=3.8.*
8+
- opencv=4.8.*
9+
- pandas=2.1.*
1210
- python=3.12
13-
- scikit-image=0.22.0
14-
- rich-click=1.8.9
11+
- scikit-image=0.24.*
12+
- rich-click=1.8.*

karios/cli/commands.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,12 @@ def cli() -> None:
119119
short_help="Performs image matching to detect pixel-level shifts between a monitored image and a reference image"
120120
)
121121
@click.argument(
122-
"monitored_image", type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path)
122+
"monitored_image",
123+
type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path),
123124
)
124125
@click.argument(
125-
"reference_image", type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path)
126+
"reference_image",
127+
type=click.Path(exists=True, file_okay=True, dir_okay=False, path_type=Path),
126128
)
127129
@click.argument(
128130
"mask_file",

karios/report/chip_service.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ def _create_vrt(self, directory_path: Path, output_vrt_name="chips.vrt"):
492492

493493
# Build VRT options
494494
vrt_options = gdal.BuildVRTOptions(
495-
separate=False, srcNodata=None, VRTNodata=0 # False for mosaic (single band)
495+
separate=False,
496+
srcNodata=None,
497+
VRTNodata=0, # False for mosaic (single band)
496498
)
497499

498500
# Create the VRT

karios/report/overview_plot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,12 @@ def _create_error_scatter(
197197
axes.axis("scaled")
198198

199199
scatter = axes.scatter(
200-
self._points["x0"], self._points["y0"], c=values, cmap=colormap, s=1, **kwargs
200+
self._points["x0"],
201+
self._points["y0"],
202+
c=values,
203+
cmap=colormap,
204+
s=1,
205+
**kwargs,
201206
)
202207

203208
axes.grid()

0 commit comments

Comments
 (0)