Skip to content

Commit

Permalink
add codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Dec 31, 2024
1 parent a154581 commit 90731b1
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
codecov:
require_ci_to_pass: yes
notify:
wait_for_ci: yes

coverage:
precision: 2
round: down
status:
project:
default:
threshold: 0.4
if_not_found: success

ignore:
- "v2_shapefile/**" # ignore WIP
- "testing_files/**" # ignore testing files
22 changes: 20 additions & 2 deletions .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ jobs:
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
- name: Test with pytest and generate coverage reports
run: |
python -m pytest
python -m pytest --cov=./pydar --cov-report=xml --junitxml=pytest.xml
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: Test results for ${{ matrix.os }}-${{ matrix.python-version }}
path: pytest.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false

1 change: 1 addition & 0 deletions pydar/error_handling.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Internal Local Imports
import pydar


def _error_handling_extract_flyby_images(flyby_observation_num=None,
flyby_id=None,
segment_num=None,
Expand Down
2 changes: 2 additions & 0 deletions pydar/extract_flyby_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def _retrieve_flyby_data() -> tuple[list, str]:
# returns a list of flyby IDs and associated Radar Data Take Number
return flyby_id, flyby_radar_take_num


def _return_segment_options() -> list:
# return a possible list of segments from sar_swath_details.csv
sar_swatch_csv = os.path.join(
Expand All @@ -113,6 +114,7 @@ def _return_segment_options() -> list:
seg_options.append(f"S{num}")
return seg_options # ['S01', 'S02', 'S03', 'S04', 'S05', 'S06', 'S07', 'S08', 'S09']


def id_to_observation(flyby_id: str = None) -> str:
# convert Flyby ID to Observation Number to find data files
pydar._error_handling_convert_id_to_observation_num(flyby_id=flyby_id)
Expand Down

0 comments on commit 90731b1

Please sign in to comment.