Skip to content

Commit

Permalink
fix pandas append deprecation error in calc_lookup.py + force sklearn…
Browse files Browse the repository at this point in the history
… to 1.2.2
  • Loading branch information
wolfidan committed Dec 20, 2023
1 parent 2f37a69 commit 7bdba8f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/test_rainforest_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test rainforest dev

on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
unit_tests:
name: Unit Tests (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest" ]
python-version: ["3.8", "3.9","3.10","3.11"]
max-parallel: 6

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v2
with:
ref: master
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install rainforest
if: matrix.os != 'macos-latest'
working-directory: ${{github.workspace}}
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install -r test_requirements.txt
pip install .
- name: Create rainforest_data folder
run: |
mkdir -p ${{github.workspace}}/rainforest_data
- name: Check imports
env:
AWS_KEY: ${{ secrets.AWS_KEY }}
RAINFOREST_DATAPATH: ${{github.workspace}}/rainforest_data
working-directory: /tmp/
run: |
python -c "import rainforest; print(rainforest.__file__)"
- name: Run tests
env:
AWS_KEY: ${{ secrets.AWS_KEY }}
RAINFOREST_DATAPATH: ${{github.workspace}}/rainforest_data
working-directory: ${{github.workspace}}
run: pytest tests_ci
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}

2 changes: 1 addition & 1 deletion rainforest/common/lookup.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ def calc_lookup(lookup_type, radar = None):
offset_x = int((neighb_x-1)/2)
offset_y = int((neighb_y-1)/2)

df_stations = df_stations.append(constants.RADARS)
df_stations = df_stations._append(constants.RADARS, ignore_index=True)
stations = df_stations['Abbrev']

lut = {}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Cython
numpy
netCDF4
prompt_toolkit
scikit-learn
scikit-learn==1.2.2
scipy
dask
pandas
Expand Down

0 comments on commit 7bdba8f

Please sign in to comment.