Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 7d1a144
Author: Craig Arthur <craig.arthur@ga.gov.au>
Date:   Tue Feb 13 08:53:11 2024 +1100

    Bump python version for pylint testing

commit 4ac1109
Merge: f000d38 8793053
Author: Craig Arthur <craig.arthur@ga.gov.au>
Date:   Tue Feb 13 08:49:43 2024 +1100

    Merge branch 'develop' of github.com:GeoscienceAustralia/tcrm into develop

commit 8793053
Author: Craig Arthur <craig.arthur@ga.gov.au>
Date:   Tue Feb 13 08:47:02 2024 +1100

    Workflow fix 1 (#144)

    * Remove deprecated Basemap references
    * Update conda environment file
    * Update actions/checkout to v3, setup-miniconda to v2.2
    * Leave shapely to dependencies
    * Remove cartopy version, bump python version
    * Stringify python version

commit f000d38
Merge: 34e4aca 2c07290
Author: Craig Arthur <craig.arthur@ga.gov.au>
Date:   Tue Feb 13 08:44:39 2024 +1100

    Merge commit '2c07290b16dbff416e1f58cb86b96c886c9d221b' into develop

commit 2c07290
Author: Craig Arthur <wcarthur@gmail.com>
Date:   Fri Jul 21 10:38:43 2023 +1000

    Change `Speed` to `WindSpeed` in track interpolation
  • Loading branch information
wcarthur committed Feb 12, 2024
1 parent b61601c commit 97cb57b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/tcrm-pylint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Pylint tests for TCRM
name: Pylint tests for TCRM

on:
on:
push:
branches: [ master, develop ]

Expand All @@ -12,17 +12,17 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up environment
uses: conda-incubator/setup-miniconda@v2.0.0
with:
python-version: 3.7
mamba-version: "*"
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
miniforge-variant: Mambaforge
channels: conda-forge,defaults
channel-priority: true
activate-environment: tcrm
environment-file: tcrmenv.yml
auto-activate-base: false
use-only-tar-bz2: true

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -32,7 +32,7 @@ jobs:
pylint --rcfile pylintrc --fail-under=7 `find -regextype egrep -regex '(.*.py)$'` |
tee pylint.txt
- name: Upload pylint.txt as artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: pylint report
path: pylint.txt
9 changes: 5 additions & 4 deletions .github/workflows/tcrm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.9', '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up environment
uses: conda-incubator/setup-miniconda@v2.0.0
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: MambaForge
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: tcrm
environment-file: tcrmenv.yml
auto-activate-base: false
use-only-tar-bz2: true


- name: Test with pytest
env:
PYTHONPATH: ~/tcrm;~/tcrm/Utilities
Expand Down
6 changes: 3 additions & 3 deletions Evaluate/interpolateTracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def interpolate(track, delta, interpolation_type=None):
track.Minute)]
else:
day_ = track.Datetime

timestep = timedelta(delta/24.)
try:
time_ = np.array([d.toordinal() + (d.hour + d.minute/60.)/24.0
Expand Down Expand Up @@ -104,7 +104,7 @@ def interpolate(track, delta, interpolation_type=None):
idx[0] = 1
# TODO: Possibly could change `np.mean(dt)` to `dt`?
track.WindSpeed = maxWindSpeed(idx, np.mean(dt), track.Longitude,
track.Latitude, track.CentralPressure,
track.Latitude, track.CentralPressure,
track.EnvPressure)
# Find the indices of valid pressure observations:
validIdx = np.where(track.CentralPressure < sys.maxsize)[0]
Expand Down Expand Up @@ -182,7 +182,7 @@ def interpolate(track, delta, interpolation_type=None):
kind='linear')(newtime[firsttime:lasttime])

_nwSpd = interp1d(timestep[validIdx],
track.Speed[validIdx],
track.WindSpeed[validIdx],
kind='linear')(newtime[firsttime:lasttime])

npCentre[firsttime:lasttime] = _npCentre
Expand Down
3 changes: 1 addition & 2 deletions tcrmenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dependencies:
- numpy
- scipy
- matplotlib
- shapely
- nose
- netcdf4
- cftime
Expand All @@ -22,7 +21,7 @@ dependencies:
- sqlite
- statsmodels
- configparser
- cartopy>=0.18.0
- cartopy
- affine
- tqdm
- xarray
Expand Down

0 comments on commit 97cb57b

Please sign in to comment.