Skip to content

Commit

Permalink
add tests to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jgriesfeller committed Dec 6, 2023
1 parent 956bc7e commit bdc043e
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 6 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,38 @@ jobs:
- name: Run linters
continue-on-error: true
run: tox -e lint

venv:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [ '3.11' ]
experimental: [ false ]
os: [ ubuntu-22.04 ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Python info
run: |
which python
python --version
- name: Cache pip and tox
uses: actions/cache@v3
if: ${{ ! matrix.experimental }}
with:
path: |
~/.cache/pip
~/.cache/srtm
.tox
key: ${{ matrix.os }}-tox-${{ matrix.python-version }}-${{ hashFiles('setup.cfg', 'pyproject.toml') }}
- name: Install Tox
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Run test
continue-on-error: ${{ matrix.experimental }}
run: tox -e py
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ requires-python = ">=3.9"
dependencies = [
"pyaro@git+https://github.com/metno/pyaro",
"requests",
"geocoder",
]

[project.urls]
Expand Down Expand Up @@ -52,9 +53,6 @@ skip_missing_interpreters = True
isolated_build = True
envlist =
py39
py310
py311
format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
Station,
Engine,
)
import requests, zipfile, io

# import requests, zipfile, io
import geocoder
from tqdm import tqdm

# from tqdm import tqdm

# default URL
BASE_URL = "https://aeronet.gsfc.nasa.gov/data_push/V3/All_Sites_Times_Daily_Averages_AOD20.zip"
Expand Down Expand Up @@ -39,13 +41,14 @@

FILL_COUNTRY_FLAG = False


class AeronetSunTimeseriesReader(AutoFilterReaderEngine.AutoFilterReader):
def __init__(
self,
filename,
csvreader_kwargs={"delimiter": DELIMITER},
filters=[],
fill_country_flag:bool = FILL_COUNTRY_FLAG,
fill_country_flag: bool = FILL_COUNTRY_FLAG,
):
"""open a new csv timeseries-reader
Expand Down
2 changes: 2 additions & 0 deletions tests/test_AERONETTimeSeriesReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def test_variables_filter(self):
)
with engine.open(self.file, filters=[vfilter]) as ts:
self.assertEqual(ts.data(new_var_name).variable, new_var_name)

def test_downloaded_file(self):
pass


Expand Down

0 comments on commit bdc043e

Please sign in to comment.