Skip to content

Commit 29b093c

Browse files
committed
2 parents 0670948 + 2bdee7c commit 29b093c

6 files changed

Lines changed: 75 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- 'master'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
name: ${{ matrix.os }}-python-${{ matrix.python-version }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
python-version: ["3.9", "3.10", "3.11", "3.12"]
23+
os: [ubuntu-latest] # only testing ubuntu
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install system dependencies
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y gfortran python3-dev build-essential
37+
gfortran --version
38+
39+
- name: Install Python dependencies
40+
run: |
41+
python -m pip install --upgrade pip setuptools wheel
42+
pip install cython pytest
43+
pip install -r requirements.txt
44+
45+
- name: Build and Install csu_radartools
46+
run: |
47+
python setup.py build_ext --inplace
48+
python setup.py install
49+
50+
- name: Run Tests
51+
run: |
52+
pytest tests/
53+
54+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: csu-radartools-dev
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- numpy
6+
- pandas
7+
- scipy
8+
- matplotlib
9+
- cython
10+
- setuptools # For building and installing the package
11+
- pytest # For running tests
12+

csu_radartools/csu_fhc_melt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def get_ml_ppi(fh, dz, height, expected_ML,
213213
npts = len(np.ravel(whsec))
214214
# print(npts)
215215
ML_num_sector = len(ML_sector)
216-
per_ML = np.float(ML_num_sector)/npts*100.
216+
per_ML = float(ML_num_sector)/npts*100.
217217
# print('ML number in sector', ML_num_sector,
218218
# 'percent of sector', per_ML)
219219
# print('Mean dz in ML', np.nanmean(dz[wh_sector1]))

csu_radartools/csu_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from __future__ import division
1616
import numpy as np
1717
from warnings import warn
18-
from scipy.ndimage.measurements import label
18+
from scipy.ndimage import label
1919

2020
VERSION = '1.3'
2121

requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
numpy
2+
pandas
3+
scipy
4+
matplotlib
5+
cython
6+

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ def get_version(module=None):
7979
include_dirs=INCLUDE_DIRS)] # <-- MOVED HERE
8080

8181
if USE_CYTHON:
82-
EXTENSIONS = cythonize(EXTENSIONS,
83-
compiler_directives={'cpow': True})
82+
EXTENSIONS = cythonize(EXTENSIONS, compiler_directives={'cpow': True})
8483

8584

8685
# Run setup

0 commit comments

Comments
 (0)