diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 16156ec..9a4ac3b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -8,14 +8,14 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install dependencies run: | diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 5d2c10b..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -image: python:3.7 - -test: - script: - # Install Python packages required to run code. Add any additional - # packages your code needs require here. - - pip install dateutils flake8 matplotlib numpy pytest requests - - # flake8 static code and style testing. Enable for extra testing. - # - python -m flake8 . - - # Run unit tests - - python -m pytest -v . - - # Run deliverables. Add your deliverables to the test system here. - - python Task1A.py - - - python Task2A.py - - python Task2D.py diff --git a/floodsystem/datafetcher.py b/floodsystem/datafetcher.py index 4738bff..2a87582 100644 --- a/floodsystem/datafetcher.py +++ b/floodsystem/datafetcher.py @@ -46,6 +46,12 @@ def fetch_station_data(use_cache=True): retrieval over the Internet and avoids excessive calls to the Environment Agency service. + Args: + use_cache: If ``True``, use file cache. Otherwise fetch data + over the Internet. + + Returns: + River level data. """ # URL for retrieving data for active stations with river level diff --git a/floodsystem/station.py b/floodsystem/station.py index cee0c85..63ab9db 100644 --- a/floodsystem/station.py +++ b/floodsystem/station.py @@ -12,6 +12,7 @@ class MonitoringStation: def __init__(self, station_id, measure_id, label, coord, typical_range, river, town): + """Create a monitoring station.""" self.station_id = station_id self.measure_id = measure_id diff --git a/floodsystem/stationdata.py b/floodsystem/stationdata.py index 1e3e61e..fc4ec4f 100644 --- a/floodsystem/stationdata.py +++ b/floodsystem/stationdata.py @@ -1,7 +1,7 @@ # Copyright (C) 2018 Garth N. Wells # # SPDX-License-Identifier: MIT -"""This module provides interface for extracting statiob data from +"""This module provides interface for extracting station data from JSON objects fetched from the Internet and """ diff --git a/floodsystem/utils.py b/floodsystem/utils.py index f049d01..8771173 100644 --- a/floodsystem/utils.py +++ b/floodsystem/utils.py @@ -10,12 +10,12 @@ def sorted_by_key(x, i, reverse=False): """For a list of lists/tuples, return list sorted by the ith component of the list/tuple, E.g. - Sort on first entry of tuple: + Sort on first entry of tuple:: > sorted_by_key([(1, 2), (5, 1]), 0) >>> [(1, 2), (5, 1)] - Sort on second entry of tuple: + Sort on second entry of tuple:: > sorted_by_key([(1, 2), (5, 1]), 1) >>> [(5, 1), (1, 2)]