Skip to content

noaa-oar-arl/pytspack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytspack

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.

Installation

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...

Windows

On Windows, with a GNU Fortran via MSYS2 setup, try the following:

  1. Clone the repo

    git clone https://github.com/noaa-oar-arl/pytspack
    cd pytspack
  2. 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 ..
  3. Link pytspack to your active Python environment.

    pip install -e . --no-use-pep517

Linux

We have seen some issues where some gccs 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.

More information

For more information on TSPACK, see the open-access paper (Renka, 1993) or the netlib page.

Footnotes

  1. Build-time dependency specification via pyproject.toml file.

  2. As mentioned here, for example.