Python Wrapper around Robert J. Renka's TSPACK.
TSPACK is a curve-fitting package based on exponential tension splines with automatic selection of tension factors.
For NOAA Hera users:
OPT='-std=c99' pip install https://github.com/noaa-oar-arl/pytspack/archive/master.zip
or see the Linux notes below.
If you are lucky,
pip install https://github.com/noaa-oar-arl/pytspack/archive/master.zip
will just work.
Alternatively, if the above 1 fails, try
pip install https://github.com/noaa-oar-arl/pytspack/archive/master.zip --no-use-pep517 --no-deps
(you must already have numpy
installed and currently must have setuptools
earlier than v65).
Otherwise, you can clone the repo and try to build the extension module
using f2py
manually...
On Windows, with a GNU Fortran via MSYS2 setup, try the following:
-
Clone the repo
git clone https://github.com/noaa-oar-arl/pytspack cd pytspack
-
Build the extension, using one of these options
Using the
setup.py
:python setup.py build_ext --fcompiler=gnu95 --compiler=mingw32 --build-lib=./pytspack
OR
Using
f2py
directly:cd pytspack python -m numpy.f2py -c --fcompiler=gnu95 --compiler=mingw32 -m tspack tspack.f cd ..
-
Link pytspack to your active Python environment.
pip install -e . --no-use-pep517
We have seen some issues where some gcc
s do not want to compile the fortranobject.c
2
Follow the same general steps as above, but don't use --compiler=mingw32
.
On NOAA Hera, the default GCC is currently v4.
Use module load gnu
to get newer before attempting to install pytspack,
or use
OPT='-std=c99' python -m numpy.f2py -c -m tspack tspack.f
to configure gcc
.
OPT='-std=c99'
can also be prepended to the pip install
above,
enabling an installation without cloning the repo.
For more information on TSPACK, see the open-access paper (Renka, 1993) or the netlib page.
Footnotes
-
Build-time dependency specification via
pyproject.toml
file. ↩