06f7832
# Tests are enabled
06f7832
%bcond_without tests
06f7832
06f7832
%global srcname SALib
06f7832
06f7832
%global _description %{expand:
06f7832
Python implementations of commonly used sensitivity analysis methods. Useful in
06f7832
systems modeling to calculate the effects of model inputs or exogenous factors
06f7832
on outputs of interest.
06f7832
06f7832
Herman, J. and Usher, W. (2017) SALib: An open-source Python library for
06f7832
sensitivity analysis. Journal of Open Source Software, 2(9).
06f7832
06f7832
Methods included:
06f7832
06f7832
- Sobol Sensitivity Analysis (Sobol 2001, Saltelli 2002, Saltelli et al. 2010)
06f7832
- Method of Morris, including groups and optimal trajectories (Morris 1991,
06f7832
  Campolongo et al. 2007)
06f7832
- Fourier Amplitude Sensitivity Test (FAST) (Cukier et al. 1973, Saltelli et
06f7832
  al. 1999)
06f7832
- Delta Moment-Independent Measure (Borgonovo 2007, Plischke et al. 2013)
06f7832
- Derivative-based Global Sensitivity Measure (DGSM) (Sobol and Kucherenko
06f7832
  2009)
06f7832
- Fractional Factorial Sensitivity Analysis (Saltelli et al. 2008)}
06f7832
06f7832
Name:           python-%{srcname}
4fdefd1
Version:        1.3.11
642d1a2
Release:        4%{?dist}
06f7832
Summary:        Sensitivity Analysis Library
06f7832
06f7832
License:        MIT
06f7832
URL:            http://salib.github.io/SALib/
06f7832
Source0:        %pypi_source
b2d73b6
06f7832
BuildArch:      noarch
06f7832
06f7832
%{?python_enable_dependency_generator}
06f7832
06f7832
%description %_description
06f7832
06f7832
%package -n python3-%{srcname}
06f7832
Summary:        %{summary}
06f7832
BuildRequires:  python3-devel
0bdfb22
BuildRequires:  %{py3_dist setuptools}
06f7832
06f7832
# Not mentioned in setup.py, so won't be picked up by the generator
06f7832
Requires:  %{py3_dist pandas}
06f7832
Requires:  %{py3_dist numpy} >= 1.9.0
06f7832
Requires:  %{py3_dist scipy}
06f7832
Requires:  %{py3_dist matplotlib} >= 1.4.3
06f7832
06f7832
%if %{with tests}
06f7832
BuildRequires:  %{py3_dist pytest}
06f7832
BuildRequires:  %{py3_dist pytest-cov}
06f7832
BuildRequires:  %{py3_dist pandas}
06f7832
BuildRequires:  %{py3_dist numpy} >= 1.9.0
06f7832
BuildRequires:  %{py3_dist scipy}
06f7832
BuildRequires:  %{py3_dist matplotlib} >= 1.4.3
06f7832
BuildRequires:  %{py3_dist pyscaffold}
06f7832
%endif
06f7832
06f7832
%{?python_provide:%python_provide python3-%{srcname}}
06f7832
06f7832
%description -n python3-%{srcname} %_description
06f7832
06f7832
%package doc
06f7832
Summary:        %{summary}
06f7832
BuildRequires:  %{py3_dist sphinx}
06f7832
BuildRequires:  %{py3_dist recommonmark}
06f7832
06f7832
%description doc
06f7832
Documentation for %{name}.
06f7832
06f7832
%prep
06f7832
%autosetup -n %{srcname}-%{version}
06f7832
# Remove egg info
06f7832
rm -rf src/%{srcname}.egg-info
06f7832
# Remove uneeded version lock on pyscaffold
06f7832
sed -i "s/pyscaffold.*']/pyscaffold']/" setup.py
06f7832
06f7832
# python3, not python in tests
06f7832
sed -i 's/python {cli}/python3 {cli}/' tests/test_cli_sample.py
06f7832
sed -i 's/python {cli}/python3 {cli}/' tests/test_cli_analyze.py
06f7832
b2d73b6
# https://github.com/SALib/SALib/commit/2eb776b6c7ff0737e4d9855709e6e24c19e36971.patch
b2d73b6
sed -i 's/rU/r/' src/SALib/util/__init__.py
b2d73b6
06f7832
# Correct permission
06f7832
chmod -x LICENSE.txt
06f7832
06f7832
# Remove /usr/bin/env python shebang
06f7832
find . -type f -name "*.py" -exec sed -i '/^#![  ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'
06f7832
06f7832
# Correct end of line encoding
06f7832
sed -i 's/\r$//' LICENSE.txt
06f7832
sed -i 's/\r$//' src/SALib/analyze/rbd_fast.py
06f7832
06f7832
%build
06f7832
%py3_build
06f7832
4fdefd1
sphinx-build-%{python3_version} docs html-docs
4fdefd1
rm -rf html-docs/{.doctrees,.buildinfo} -vf
06f7832
06f7832
%install
06f7832
%py3_install
06f7832
06f7832
# Add a shebang to missing script
06f7832
sed -i "1 i \#\!%{__python3}" $RPM_BUILD_ROOT/%{_bindir}/salib.py
06f7832
06f7832
%check
06f7832
%if %{with tests}
06f7832
PYTHONPATH=$RPM_BUILD_ROOT%{python3_sitelib} pytest-%{python3_version}
06f7832
%endif
06f7832
06f7832
%files -n python3-%{srcname}
06f7832
%license LICENSE.txt
06f7832
%doc README.rst README-advanced.md CHANGELOG.rst CITATIONS.rst AUTHORS.rst
06f7832
%{python3_sitelib}/%{srcname}
06f7832
%{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
06f7832
%{_bindir}/salib
06f7832
%{_bindir}/salib.py
06f7832
06f7832
%files doc
06f7832
%license LICENSE.txt
4fdefd1
%doc html-docs
06f7832
06f7832
%changelog
642d1a2
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.11-4
642d1a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
642d1a2
0bdfb22
* Thu Jun 25 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.11-3
0bdfb22
- Explicitly BR setuptools
0bdfb22
78d04cc
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.11-2
78d04cc
- Rebuilt for Python 3.9
78d04cc
4fdefd1
* Wed Apr 22 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.11-1
4fdefd1
- Update to new release
4fdefd1
b2d73b6
* Mon Mar 16 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.8-2
b2d73b6
- Add patch to fix for python 3.9
b2d73b6
- https://bugzilla.redhat.com/show_bug.cgi?id=1794093
b2d73b6
25a0fb6
* Sun Feb 16 2020 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.8-1
25a0fb6
- Update to latest release
25a0fb6
b51b91d
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.7-4
b51b91d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
b51b91d
c8ef6f1
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-3
c8ef6f1
- Rebuilt for Python 3.8.0rc1 (#1748018)
c8ef6f1
3740101
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.7-2
3740101
- Rebuilt for Python 3.8
3740101
06f7832
* Mon Aug 05 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.3.7-1
06f7832
- Update to new release
06f7832
06f7832
* Tue Jan 29 2019 Ankur Sinha <ankursinha AT fedoraproject DOT org> - 1.1.3-1
06f7832
- Initial build