%global _empty_manifest_terminate_build 0 Name: python-csaps Version: 1.1.0 Release: 1 Summary: Cubic spline approximation (smoothing) License: MIT URL: https://github.com/espdev/csaps Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f3/de/ef40ae9b0485b36c0128d0d0065e065d7dc8fa3c2334a886548dc70e8ad7/csaps-1.1.0.tar.gz BuildArch: noarch Requires: python3-numpy Requires: python3-scipy Requires: python3-sphinx Requires: python3-matplotlib Requires: python3-numpydoc Requires: python3-m2r2 Requires: python3-pytest Requires: python3-coverage Requires: python3-pytest-cov Requires: python3-coveralls %description
**csaps** is a Python package for univariate, multivariate and n-dimensional grid data approximation using cubic smoothing splines. The package can be useful in practical engineering tasks for data approximation and smoothing. ## Installing Use pip for installing: ``` pip install -U csaps ``` The module depends only on NumPy and SciPy. Python 3.6 or above is supported. ## Simple Examples Here is a couple of examples of smoothing data. An univariate data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from csaps import csaps np.random.seed(1234) x = np.linspace(-5., 5., 25) y = np.exp(-(x/2.5)**2) + (np.random.rand(25) - 0.2) * 0.3 xs = np.linspace(x[0], x[-1], 150) ys = csaps(x, y, xs, smooth=0.85) plt.plot(x, y, 'o', xs, ys, '-') plt.show() ```A surface data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from csaps import csaps np.random.seed(1234) xdata = [np.linspace(-3, 3, 41), np.linspace(-3.5, 3.5, 31)] i, j = np.meshgrid(*xdata, indexing='ij') ydata = (3 * (1 - j)**2. * np.exp(-(j**2) - (i + 1)**2) - 10 * (j / 5 - j**3 - i**5) * np.exp(-j**2 - i**2) - 1 / 3 * np.exp(-(j + 1)**2 - i**2)) ydata = ydata + (np.random.randn(*ydata.shape) * 0.75) ydata_s = csaps(xdata, ydata, xdata, smooth=0.988) fig = plt.figure(figsize=(7, 4.5)) ax = fig.add_subplot(111, projection='3d') ax.set_facecolor('none') c = [s['color'] for s in plt.rcParams['axes.prop_cycle']] ax.plot_wireframe(j, i, ydata, linewidths=0.5, color=c[0], alpha=0.5) ax.scatter(j, i, ydata, s=10, c=c[0], alpha=0.5) ax.plot_surface(j, i, ydata_s, color=c[1], linewidth=0, alpha=1.0) ax.view_init(elev=9., azim=290) plt.show() ```
## Documentation More examples of usage and the full documentation can be found at https://csaps.readthedocs.io. ## Testing We use pytest for testing. ``` cd /path/to/csaps/project/directory pip install -e .[tests] pytest ``` ## Algorithm and Implementation **csaps** Python package is inspired by MATLAB [CSAPS](https://www.mathworks.com/help/curvefit/csaps.html) function that is an implementation of Fortran routine SMOOTH from [PGS](http://pages.cs.wisc.edu/~deboor/pgs/) (originally written by Carl de Boor). Also the algothithm implementation in other languages: * [csaps-rs](https://github.com/espdev/csaps-rs) Rust ndarray/sprs based implementation * [csaps-cpp](https://github.com/espdev/csaps-cpp) C++11 Eigen based implementation (incomplete) ## References C. de Boor, A Practical Guide to Splines, Springer-Verlag, 1978. ## License [MIT](https://choosealicense.com/licenses/mit/) # Changelog ## v1.1.0 * Introduced optional `normalizedsmooth` argument to reduce dependence on xdata and weights [#47](https://github.com/espdev/csaps/pull/47) * Update numpy and scipy dependency ranges ## v1.0.4 (04.05.2021) * Bump numpy dependency version ## v1.0.3 (01.01.2021) * Bump scipy dependency version * Bump sphinx dependency version and use m2r2 sphinx extension instead of m2r * Add Python 3.9 to classifiers list and to Travis CI * Set development status classifier to "5 - Production/Stable" * Happy New Year! ## v1.0.2 (19.07.2020) * Fix using 'nu' argument when n-d grid spline evaluating [#32](https://github.com/espdev/csaps/pull/32) ## v1.0.1 (19.07.2020) * Fix n-d grid spline evaluating performance regression [#31](https://github.com/espdev/csaps/pull/31) ## v1.0.0 (11.07.2020) * Use `PPoly` and `NdPPoly` base classes from SciPy interpolate module for `SplinePPForm` and `NdGridSplinePPForm` respectively. * Remove deprecated classes `UnivariateCubicSmoothingSpline` and `MultivariateCubicSmoothingSpline` * Update the documentation **Notes** In this release the spline representation (the array of spline coefficients) has been changed according to `PPoly`/`NdPPoly`. See SciPy [PPoly](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PPoly.html) and [NdPPoly](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.NdPPoly.html) documentation for details. ## v0.11.0 (28.03.2020) * Internal re-design `SplinePPForm` and `NdGridSplinePPForm` classes [#17](https://github.com/espdev/csaps/issues/17): - Remove `shape` and `axis` properties and reshaping data in these classes - `NdGridSplinePPForm` coefficients array for 1D grid now is 1-d instead of 2-d * Refactoring the code and decrease memory consumption * Add `overload` type-hints for `csaps` function signatures ## v0.10.1 (19.03.2020) * Fix call of `numpy.pad` function for numpy <1.17 [#15](https://github.com/espdev/csaps/issues/15) ## v0.10.0 (18.02.2020) * Significant performance improvements for make/evaluate splines and memory consumption optimization * Change format for storing spline coefficients (reshape coeffs array) to improve performance * Add shape property to `SplinePPForm`/`NdGridSplinePPForm` and axis property to `SplinePPForm` * Fix issues with the smoothing factor in nd-grid case: inverted ordering and unnable to use 0.0 value * Update documentation ## v0.9.0 (21.01.2020) * Drop support of Python 3.5 * `weights`, `smooth` and `axis` arguments in `csaps` function are keyword-only now * `UnivariateCubicSmoothingSpline` and `MultivariateCubicSmoothingSpline` classes are deprecated and will be removed in 1.0.0 version. Use `CubicSmoothingSpline` instead. ## v0.8.0 (13.01.2020) * Add `csaps` function that can be used as the main API * Refactor the internal structure of the package * Add the [documentation](https://csaps.readthedocs.io) **Attention** This is the last version that supports Python 3.5. The next versions will support Python 3.6 or above. ## v0.7.0 (19.09.2019) * Add Generic-based type-hints and mypy-compatibility ## v0.6.1 (13.09.2019) * A slight refactoring and extra data copies removing ## v0.6.0 (12.09.2019) * Add "axis" parameter for univariate/multivariate cases ## v0.5.0 (10.06.2019) * Reorganize the project to package-based structure * Add the interface class for all smoothing spline classes ## v0.4.2 (07.09.2019) * FIX: "smooth" value is 0.0 was not used ## v0.4.1 (30.05.2019) * First PyPI release %package -n python3-csaps Summary: Cubic spline approximation (smoothing) Provides: python-csaps BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-csaps **csaps** is a Python package for univariate, multivariate and n-dimensional grid data approximation using cubic smoothing splines. The package can be useful in practical engineering tasks for data approximation and smoothing. ## Installing Use pip for installing: ``` pip install -U csaps ``` The module depends only on NumPy and SciPy. Python 3.6 or above is supported. ## Simple Examples Here is a couple of examples of smoothing data. An univariate data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from csaps import csaps np.random.seed(1234) x = np.linspace(-5., 5., 25) y = np.exp(-(x/2.5)**2) + (np.random.rand(25) - 0.2) * 0.3 xs = np.linspace(x[0], x[-1], 150) ys = csaps(x, y, xs, smooth=0.85) plt.plot(x, y, 'o', xs, ys, '-') plt.show() ```
A surface data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from csaps import csaps np.random.seed(1234) xdata = [np.linspace(-3, 3, 41), np.linspace(-3.5, 3.5, 31)] i, j = np.meshgrid(*xdata, indexing='ij') ydata = (3 * (1 - j)**2. * np.exp(-(j**2) - (i + 1)**2) - 10 * (j / 5 - j**3 - i**5) * np.exp(-j**2 - i**2) - 1 / 3 * np.exp(-(j + 1)**2 - i**2)) ydata = ydata + (np.random.randn(*ydata.shape) * 0.75) ydata_s = csaps(xdata, ydata, xdata, smooth=0.988) fig = plt.figure(figsize=(7, 4.5)) ax = fig.add_subplot(111, projection='3d') ax.set_facecolor('none') c = [s['color'] for s in plt.rcParams['axes.prop_cycle']] ax.plot_wireframe(j, i, ydata, linewidths=0.5, color=c[0], alpha=0.5) ax.scatter(j, i, ydata, s=10, c=c[0], alpha=0.5) ax.plot_surface(j, i, ydata_s, color=c[1], linewidth=0, alpha=1.0) ax.view_init(elev=9., azim=290) plt.show() ```
## Documentation More examples of usage and the full documentation can be found at https://csaps.readthedocs.io. ## Testing We use pytest for testing. ``` cd /path/to/csaps/project/directory pip install -e .[tests] pytest ``` ## Algorithm and Implementation **csaps** Python package is inspired by MATLAB [CSAPS](https://www.mathworks.com/help/curvefit/csaps.html) function that is an implementation of Fortran routine SMOOTH from [PGS](http://pages.cs.wisc.edu/~deboor/pgs/) (originally written by Carl de Boor). Also the algothithm implementation in other languages: * [csaps-rs](https://github.com/espdev/csaps-rs) Rust ndarray/sprs based implementation * [csaps-cpp](https://github.com/espdev/csaps-cpp) C++11 Eigen based implementation (incomplete) ## References C. de Boor, A Practical Guide to Splines, Springer-Verlag, 1978. ## License [MIT](https://choosealicense.com/licenses/mit/) # Changelog ## v1.1.0 * Introduced optional `normalizedsmooth` argument to reduce dependence on xdata and weights [#47](https://github.com/espdev/csaps/pull/47) * Update numpy and scipy dependency ranges ## v1.0.4 (04.05.2021) * Bump numpy dependency version ## v1.0.3 (01.01.2021) * Bump scipy dependency version * Bump sphinx dependency version and use m2r2 sphinx extension instead of m2r * Add Python 3.9 to classifiers list and to Travis CI * Set development status classifier to "5 - Production/Stable" * Happy New Year! ## v1.0.2 (19.07.2020) * Fix using 'nu' argument when n-d grid spline evaluating [#32](https://github.com/espdev/csaps/pull/32) ## v1.0.1 (19.07.2020) * Fix n-d grid spline evaluating performance regression [#31](https://github.com/espdev/csaps/pull/31) ## v1.0.0 (11.07.2020) * Use `PPoly` and `NdPPoly` base classes from SciPy interpolate module for `SplinePPForm` and `NdGridSplinePPForm` respectively. * Remove deprecated classes `UnivariateCubicSmoothingSpline` and `MultivariateCubicSmoothingSpline` * Update the documentation **Notes** In this release the spline representation (the array of spline coefficients) has been changed according to `PPoly`/`NdPPoly`. See SciPy [PPoly](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PPoly.html) and [NdPPoly](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.NdPPoly.html) documentation for details. ## v0.11.0 (28.03.2020) * Internal re-design `SplinePPForm` and `NdGridSplinePPForm` classes [#17](https://github.com/espdev/csaps/issues/17): - Remove `shape` and `axis` properties and reshaping data in these classes - `NdGridSplinePPForm` coefficients array for 1D grid now is 1-d instead of 2-d * Refactoring the code and decrease memory consumption * Add `overload` type-hints for `csaps` function signatures ## v0.10.1 (19.03.2020) * Fix call of `numpy.pad` function for numpy <1.17 [#15](https://github.com/espdev/csaps/issues/15) ## v0.10.0 (18.02.2020) * Significant performance improvements for make/evaluate splines and memory consumption optimization * Change format for storing spline coefficients (reshape coeffs array) to improve performance * Add shape property to `SplinePPForm`/`NdGridSplinePPForm` and axis property to `SplinePPForm` * Fix issues with the smoothing factor in nd-grid case: inverted ordering and unnable to use 0.0 value * Update documentation ## v0.9.0 (21.01.2020) * Drop support of Python 3.5 * `weights`, `smooth` and `axis` arguments in `csaps` function are keyword-only now * `UnivariateCubicSmoothingSpline` and `MultivariateCubicSmoothingSpline` classes are deprecated and will be removed in 1.0.0 version. Use `CubicSmoothingSpline` instead. ## v0.8.0 (13.01.2020) * Add `csaps` function that can be used as the main API * Refactor the internal structure of the package * Add the [documentation](https://csaps.readthedocs.io) **Attention** This is the last version that supports Python 3.5. The next versions will support Python 3.6 or above. ## v0.7.0 (19.09.2019) * Add Generic-based type-hints and mypy-compatibility ## v0.6.1 (13.09.2019) * A slight refactoring and extra data copies removing ## v0.6.0 (12.09.2019) * Add "axis" parameter for univariate/multivariate cases ## v0.5.0 (10.06.2019) * Reorganize the project to package-based structure * Add the interface class for all smoothing spline classes ## v0.4.2 (07.09.2019) * FIX: "smooth" value is 0.0 was not used ## v0.4.1 (30.05.2019) * First PyPI release %package help Summary: Development documents and examples for csaps Provides: python3-csaps-doc %description help **csaps** is a Python package for univariate, multivariate and n-dimensional grid data approximation using cubic smoothing splines. The package can be useful in practical engineering tasks for data approximation and smoothing. ## Installing Use pip for installing: ``` pip install -U csaps ``` The module depends only on NumPy and SciPy. Python 3.6 or above is supported. ## Simple Examples Here is a couple of examples of smoothing data. An univariate data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from csaps import csaps np.random.seed(1234) x = np.linspace(-5., 5., 25) y = np.exp(-(x/2.5)**2) + (np.random.rand(25) - 0.2) * 0.3 xs = np.linspace(x[0], x[-1], 150) ys = csaps(x, y, xs, smooth=0.85) plt.plot(x, y, 'o', xs, ys, '-') plt.show() ```
A surface data smoothing: ```python import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from csaps import csaps np.random.seed(1234) xdata = [np.linspace(-3, 3, 41), np.linspace(-3.5, 3.5, 31)] i, j = np.meshgrid(*xdata, indexing='ij') ydata = (3 * (1 - j)**2. * np.exp(-(j**2) - (i + 1)**2) - 10 * (j / 5 - j**3 - i**5) * np.exp(-j**2 - i**2) - 1 / 3 * np.exp(-(j + 1)**2 - i**2)) ydata = ydata + (np.random.randn(*ydata.shape) * 0.75) ydata_s = csaps(xdata, ydata, xdata, smooth=0.988) fig = plt.figure(figsize=(7, 4.5)) ax = fig.add_subplot(111, projection='3d') ax.set_facecolor('none') c = [s['color'] for s in plt.rcParams['axes.prop_cycle']] ax.plot_wireframe(j, i, ydata, linewidths=0.5, color=c[0], alpha=0.5) ax.scatter(j, i, ydata, s=10, c=c[0], alpha=0.5) ax.plot_surface(j, i, ydata_s, color=c[1], linewidth=0, alpha=1.0) ax.view_init(elev=9., azim=290) plt.show() ```
## Documentation More examples of usage and the full documentation can be found at https://csaps.readthedocs.io. ## Testing We use pytest for testing. ``` cd /path/to/csaps/project/directory pip install -e .[tests] pytest ``` ## Algorithm and Implementation **csaps** Python package is inspired by MATLAB [CSAPS](https://www.mathworks.com/help/curvefit/csaps.html) function that is an implementation of Fortran routine SMOOTH from [PGS](http://pages.cs.wisc.edu/~deboor/pgs/) (originally written by Carl de Boor). Also the algothithm implementation in other languages: * [csaps-rs](https://github.com/espdev/csaps-rs) Rust ndarray/sprs based implementation * [csaps-cpp](https://github.com/espdev/csaps-cpp) C++11 Eigen based implementation (incomplete) ## References C. de Boor, A Practical Guide to Splines, Springer-Verlag, 1978. ## License [MIT](https://choosealicense.com/licenses/mit/) # Changelog ## v1.1.0 * Introduced optional `normalizedsmooth` argument to reduce dependence on xdata and weights [#47](https://github.com/espdev/csaps/pull/47) * Update numpy and scipy dependency ranges ## v1.0.4 (04.05.2021) * Bump numpy dependency version ## v1.0.3 (01.01.2021) * Bump scipy dependency version * Bump sphinx dependency version and use m2r2 sphinx extension instead of m2r * Add Python 3.9 to classifiers list and to Travis CI * Set development status classifier to "5 - Production/Stable" * Happy New Year! ## v1.0.2 (19.07.2020) * Fix using 'nu' argument when n-d grid spline evaluating [#32](https://github.com/espdev/csaps/pull/32) ## v1.0.1 (19.07.2020) * Fix n-d grid spline evaluating performance regression [#31](https://github.com/espdev/csaps/pull/31) ## v1.0.0 (11.07.2020) * Use `PPoly` and `NdPPoly` base classes from SciPy interpolate module for `SplinePPForm` and `NdGridSplinePPForm` respectively. * Remove deprecated classes `UnivariateCubicSmoothingSpline` and `MultivariateCubicSmoothingSpline` * Update the documentation **Notes** In this release the spline representation (the array of spline coefficients) has been changed according to `PPoly`/`NdPPoly`. See SciPy [PPoly](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.PPoly.html) and [NdPPoly](https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.NdPPoly.html) documentation for details. ## v0.11.0 (28.03.2020) * Internal re-design `SplinePPForm` and `NdGridSplinePPForm` classes [#17](https://github.com/espdev/csaps/issues/17): - Remove `shape` and `axis` properties and reshaping data in these classes - `NdGridSplinePPForm` coefficients array for 1D grid now is 1-d instead of 2-d * Refactoring the code and decrease memory consumption * Add `overload` type-hints for `csaps` function signatures ## v0.10.1 (19.03.2020) * Fix call of `numpy.pad` function for numpy <1.17 [#15](https://github.com/espdev/csaps/issues/15) ## v0.10.0 (18.02.2020) * Significant performance improvements for make/evaluate splines and memory consumption optimization * Change format for storing spline coefficients (reshape coeffs array) to improve performance * Add shape property to `SplinePPForm`/`NdGridSplinePPForm` and axis property to `SplinePPForm` * Fix issues with the smoothing factor in nd-grid case: inverted ordering and unnable to use 0.0 value * Update documentation ## v0.9.0 (21.01.2020) * Drop support of Python 3.5 * `weights`, `smooth` and `axis` arguments in `csaps` function are keyword-only now * `UnivariateCubicSmoothingSpline` and `MultivariateCubicSmoothingSpline` classes are deprecated and will be removed in 1.0.0 version. Use `CubicSmoothingSpline` instead. ## v0.8.0 (13.01.2020) * Add `csaps` function that can be used as the main API * Refactor the internal structure of the package * Add the [documentation](https://csaps.readthedocs.io) **Attention** This is the last version that supports Python 3.5. The next versions will support Python 3.6 or above. ## v0.7.0 (19.09.2019) * Add Generic-based type-hints and mypy-compatibility ## v0.6.1 (13.09.2019) * A slight refactoring and extra data copies removing ## v0.6.0 (12.09.2019) * Add "axis" parameter for univariate/multivariate cases ## v0.5.0 (10.06.2019) * Reorganize the project to package-based structure * Add the interface class for all smoothing spline classes ## v0.4.2 (07.09.2019) * FIX: "smooth" value is 0.0 was not used ## v0.4.1 (30.05.2019) * First PyPI release %prep %autosetup -n csaps-1.1.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-csaps -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Sun Apr 23 2023 Python_Bot