Giter Club home page Giter Club logo

vam.whittaker's Introduction

vam.whittaker

CI version downloads license


Whittaker core functionality used in the modape package

State-of-the art whittaker smoother, implemented as fast C-extension through Cython and including a V-curve optimization of the smoothing parameter.

Includes the following variations of the whittaker smoother with 2nd order differences:

  • ws2d: Whittaker with fixed smoothing parameter (s)
  • ws2dp: Whittaker with fixed smoothing parameter (s) and expectile smoothing using asymmetric weights
  • ws2doptv: Whittaker with V-curve optimization of the smoothing parameter (s)
  • ws2doptvp: Whittaker with V-curve optimization of the smoothing parameter (s) and expectile smoothing using asymmetric weights

Installation

Dependencies:

vam.whittaker depends on numpy. For building the c-extension, Cython is required.

Installation from PyPI:

$ pip install vam.whittaker

Installation from github:

$ git clone https://github.com/WFP-VAM/vam.whittaker
$ cd vam.whittaker
$ pip install .

Usage

import vam.whittaker

# or

from vam.whittaker import * # ws2d, ws2dp, ws2doptv, ws2optvp, lag1corr

For examples on the usage of the different functions, check out the modape jupyter notebook!

Bugs, typos & feature requests

If you find a bug, see a typo, have some kind of troubles running the module or just simply want to have a feature added, please submit an issue!

CHANGES

  • v1.0.0:
    • initial release
  • v1.0.1:
    • minor version issue fix
  • v2.0.0:
    • new function wsdp & fix for ws2doptvp
  • v2.0.1:
    • minor bugfix in wsdp
  • v2.0.2:
    • distribute built extension on pypi
  • v2.0.3:
    • restructure and improve packaging
  • v2.0.6:
    • fix module import and wheel packaging

References:

P. H. C. Eilers, V. Pesendorfer and R. Bonifacio, "Automatic smoothing of remote sensing data," 2017 9th International Workshop on the Analysis of Multitemporal Remote Sensing Images (MultiTemp), Brugge, 2017, pp. 1-3. doi: 10.1109/Multi-Temp.2017.8076705 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8076705&isnumber=8035194

Core Whittaker function adapted from whit2 function from R package ptw:

Bloemberg, T. G. et al. (2010) "Improved Parametric Time Warping for Proteomics", Chemometrics and Intelligent Laboratory Systems, 104 (1), 65-74

Wehrens, R. et al. (2015) "Fast parametric warping of peak lists", Bioinformatics, in press.

vam.whittaker's People

Contributors

valpesendorfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vam.whittaker's Issues

pip broken

Hi WFP-VAM

It seems that the pip repository is broken. I got this issue : gcc: error: src/_whittaker.c: No such file or directory

Using the git clone ... pip install . works good.

Thanks

Martin

Constant timestamp

Hello Valentin,

Sorry for contacting you here but the email I sent you bounced back. Is it possible to use the code with observations at non-constant intervals - i.e. not assuming the use of 8-days MODIS NDVI data? Thanks a lot!

S

Unable to install source distribution in fresh environment

setup.py has a dependency on numpy:

import numpy

which makes it difficult to install a source distribution of vam.whittaker in a fresh environment (without numpy)

e.g. version 2.0.2 has no wheel distribution for python 3.10: https://pypi.org/project/vam.whittaker/2.0.2/#files
Docker based example of trying to install it:

$ docker run --rm -it python:3.10 /bin/bash

root@f0a2ef21b90e:/# pip install "vam.whittaker==2.0.2"
Collecting vam.whittaker==2.0.2
  Downloading vam.whittaker-2.0.2.tar.gz (25 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-4a150zqr/vam-whittaker_11498c8e2e244ebe9d9cc039263f3f62/setup.py", line 7, in <module>
          import numpy
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

no wheels for python 3.10 and higher

Latest vam.whittaker release (2.0.2) only supplies wheels for python 3.6, 3.7, 3.8 and 3.9:
https://pypi.org/project/vam.whittaker/2.0.2/#files

This makes installation in environments with python 3.10 or higher hard.

e.g. for the fuseTS project, which depends on vam.whitakker, we use github actions to run unit tests and these started to fail because installation of vam.whitakker fails in a python3.10 setup with latests pip: Open-EO/FuseTS#84

Attempt to reproduce this with a minimal docker use case:

$ docker run --rm -it python:3.10 /bin/bash

# Get latest pip
root@c8059a8ddeb0:/# pip install -U pip
...
Successfully installed pip-23.2.1

# Attempt to recreate github-actions-like environment
root@8b38622099c3:/# pip uninstall -y wheel setuptools

# per https://github.com/WFP-VAM/vam.whittaker/issues/4
root@c8059a8ddeb0:/# pip install numpy cython

# Now, install vam.whittaker
root@8b38622099c3:/# pip install "vam.whittaker==2.0.2"
Collecting vam.whittaker==2.0.2
  Downloading vam.whittaker-2.0.2.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 7, in <module>
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

this issue is related to #4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.