Skip to content

Commit 172c7aa

Browse files
committed
Update dependencies and docs,, add GitHub action, and clean up
fixes #6 fixes #7 fixes #8
1 parent 08c10c1 commit 172c7aa

File tree

14 files changed

+75
-176
lines changed

14 files changed

+75
-176
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build the Python Wheel
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ 'v*' ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
12+
build:
13+
strategy:
14+
matrix:
15+
include:
16+
- name: x86-windows
17+
image: windows-2022
18+
arch: x86
19+
- name: x86_64-windows
20+
image: windows-2022
21+
arch: x86_64
22+
- name: x86_64-linux
23+
image: ubuntu-20.04
24+
arch: x86_64
25+
- name: x86_64-darwin
26+
image: macos-12
27+
arch: x86_64
28+
runs-on: ${{ matrix.image }}
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
- name: Setup Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.x'
36+
- name: Query Python executable
37+
run: which python
38+
- name: Install dependencies
39+
run: python -m pip install h5py matplotlib numpy pytest scipy wheel
40+
- name: Build Python Wheel
41+
run: python setup.py bdist_wheel
42+
- name: Install Python Wheel
43+
shell: bash
44+
run: |
45+
for f in dist/SDF-*-py3-none-any.whl; do
46+
python -m pip install $f --no-deps -vv
47+
done
48+
- name: Run Python tests
49+
run: pytest tests
50+
- name: Upload artifacts
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: ${{ matrix.name }}
54+
path: dist/*.whl
55+
if-no-files-found: error

.travis.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

DEV_README.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
.. image:: https://ci.appveyor.com/api/projects/status/github/ScientificDataFormat/SDF-Python?branch=master
2-
3-
41
Scientific Data Format for Python
52
=================================
63

@@ -26,7 +23,7 @@ To install the latest release from `PyPI <https://pypi.python.org/pypi/sdf/>`_ o
2623

2724
To install the latest development version::
2825

29-
python -m pip install --upgrade https://github.com/ScientificDataFormat/SDF-Python/archive/develop.zip
26+
python -m pip install --upgrade https://github.com/ScientificDataFormat/SDF-Python/archive/main.zip
3027

3128

3229
Tutorial
@@ -72,7 +69,7 @@ Get the scale for the first dimension:
7269

7370
-----------------------------
7471

75-
|copyright| 2020 |Dassault Systemes|
72+
|copyright| 2024 |Dassault Systemes|
7673

7774
.. _SDF specification: https://github.com/ScientificDataFormat/SDF
7875
.. _HDF5: https://www.hdfgroup.org/hdf5/

appveyor.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
h5py
22
matplotlib
3-
numpy
3+
numpy>=2
44
xlrd
55
scipy

sdf/examples/interp_1d.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818

1919
figure, axes = plt.subplots(len(methods), sharex=True)
2020

21-
figure.canvas.set_window_title('Inter- and Extrapolation Methods')
2221
figure.set_facecolor('white')
2322

2423
for ax, method in zip(axes, methods):
2524
yi = table.evaluate((xi,), interp=method[0], extrap=method[1])
2625
dyi = table.evaluate_derivative((xi,), (dxi,), interp=method[0], extrap=method[1])
2726
ax.set_title("interp='%s', extrap='%s'" % method)
28-
ax.grid(b=True, which='both', color='0.9', linestyle='-', zorder=0)
27+
ax.grid(True, color='0.9')
2928
ax.plot(x, y, 'or', label='samples', zorder=300)
3029
ax.plot(xi, yi, 'b', label='interpolated', zorder=100)
3130
ax.plot(xi, dyi, 'r', label='derivative', zorder=100)

sdf/examples/interp_2d.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def peaks(x=np.linspace(-3, 3, 49), y=np.linspace(-3, 3, 49)):
2121
XI, YI = np.meshgrid(xi, yi, indexing='ij')
2222

2323
figure, axes = plt.subplots(ncols=2, nrows=2, sharex=True, sharey=True)
24-
figure.canvas.set_window_title('Inter- & Extrapolation Methods')
2524
figure.set_facecolor('white')
2625

2726
axes = axes.flatten()
@@ -31,7 +30,7 @@ def peaks(x=np.linspace(-3, 3, 49), y=np.linspace(-3, 3, 49)):
3130
im = NonUniformImage(ax)
3231
im.set_data(x, y, Z)
3332
im.set_extent((-3, 3, -3, 3))
34-
ax.images.append(im)
33+
ax.add_image(im)
3534
ax.set_xlim([-6, 6])
3635
ax.set_ylim([-6, 6])
3736

@@ -43,7 +42,7 @@ def peaks(x=np.linspace(-3, 3, 49), y=np.linspace(-3, 3, 49)):
4342
im = NonUniformImage(ax)
4443
im.set_data(xi, yi, ZI)
4544
im.set_extent((-6, 6, -6, 6))
46-
ax.images.append(im)
45+
ax.add_image(im)
4746

4847
figure.tight_layout()
4948
plt.show()

sdf/examples/spline_1d.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020

2121
figure, axes = plt.subplots(len(methods), sharex=True)
2222

23-
figure.canvas.set_window_title('Spline based interpolation methods')
2423
figure.set_facecolor('white')
2524

2625
for ax, method in zip(axes, methods):
2726
yi = table.evaluate((xi,), interp=method, extrap='linear')
2827
dyi = table.evaluate_derivative((xi,), (dxi,), interp=method, extrap='linear')
2928
ax.set_title(method)
30-
ax.grid(b=True, which='both', color='0.9', linestyle='-', zorder=0)
29+
ax.grid(True, color='0.9')
3130
ax.plot(x, y, 'or', label='samples', zorder=300)
3231
ax.plot(xi, yi, 'b', label='interpolated', zorder=100)
3332
ax.plot(xi, dyi, 'r', label='derivative', zorder=100)

0 commit comments

Comments
 (0)