Hello community, here is the log from the commit of package python-pyDOE2 for openSUSE:Leap:15.2 checked in at 2020-03-09 18:10:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/python-pyDOE2 (Old) and /work/SRC/openSUSE:Leap:15.2/.python-pyDOE2.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyDOE2" Mon Mar 9 18:10:58 2020 rev:4 rq:776949 version:1.3.0 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/python-pyDOE2/python-pyDOE2.changes 2020-01-15 15:51:45.315539848 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.python-pyDOE2.new.26092/python-pyDOE2.changes 2020-03-09 18:10:59.693164679 +0100 @@ -1,0 +2,18 @@ +Thu Jan 30 15:21:37 UTC 2020 - Todd R <[email protected]> + +- Update to version 1.3.0 + * Added latin hypercude with enforced correlation + +------------------------------------------------------------------- +Fri Jul 26 16:47:18 UTC 2019 - Todd R <[email protected]> + +- Update to version 1.2.1 + * Update doe_factorial.fractfact + +------------------------------------------------------------------- +Tue Jul 23 20:22:11 UTC 2019 - Todd R <[email protected]> + +- Update to version 1.2.0 + * BUG make sure to compute the correlation coeff properly + +------------------------------------------------------------------- Old: ---- pyDOE2-1.1.2.tar.gz New: ---- pyDOE2-1.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-pyDOE2.spec ++++++ --- /var/tmp/diff_new_pack.7vs1ji/_old 2020-03-09 18:10:59.969165074 +0100 +++ /var/tmp/diff_new_pack.7vs1ji/_new 2020-03-09 18:10:59.969165074 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-pyDOE2 # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,18 +18,16 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-pyDOE2 -Version: 1.1.2 +Version: 1.3.0 Release: 0 Summary: Design of experiments for Python License: BSD-3-Clause Group: Development/Languages/Python -Url: https://github.com/clicumu/pyDOE2 +URL: https://github.com/clicumu/pyDOE2 Source: https://files.pythonhosted.org/packages/source/p/pyDOE2/pyDOE2-%{version}.tar.gz -BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: unzip # SECTION test requirements BuildRequires: %{python_module numpy} BuildRequires: %{python_module scipy} ++++++ pyDOE2-1.1.2.tar.gz -> pyDOE2-1.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyDOE2-1.1.2/PKG-INFO new/pyDOE2-1.3.0/PKG-INFO --- old/pyDOE2-1.1.2/PKG-INFO 2018-11-13 09:04:44.000000000 +0100 +++ new/pyDOE2-1.3.0/PKG-INFO 2020-01-27 12:37:40.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: pyDOE2 -Version: 1.1.2 +Version: 1.3.0 Summary: Design of experiments for Python Home-page: https://github.com/clicumu/pyDOE2 Author: Rickard Sjoegren @@ -151,3 +151,4 @@ Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Utilities +Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyDOE2-1.1.2/pyDOE2/doe_factorial.py new/pyDOE2-1.3.0/pyDOE2/doe_factorial.py --- old/pyDOE2-1.1.2/pyDOE2/doe_factorial.py 2018-01-31 15:45:46.000000000 +0100 +++ new/pyDOE2-1.3.0/pyDOE2/doe_factorial.py 2019-07-24 13:19:19.000000000 +0200 @@ -198,7 +198,7 @@ """ # Recognize letters and combinations - A = [item for item in re.split('\-?\s?\+?', gen) if item] # remove empty strings + A = [item for item in re.split('\-|\s|\+', gen) if item] # remove empty strings C = [len(item) for item in A] # Indices of single letters (main factors) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyDOE2-1.1.2/pyDOE2/doe_lhs.py new/pyDOE2-1.3.0/pyDOE2/doe_lhs.py --- old/pyDOE2-1.1.2/pyDOE2/doe_lhs.py 2018-01-31 15:45:46.000000000 +0100 +++ new/pyDOE2-1.3.0/pyDOE2/doe_lhs.py 2020-01-27 12:36:47.000000000 +0100 @@ -15,11 +15,14 @@ import numpy as np from scipy import spatial +from scipy import stats +from scipy import linalg +from numpy import ma __all__ = ['lhs'] -def lhs(n, samples=None, criterion=None, iterations=None, random_state=None): +def lhs(n, samples=None, criterion=None, iterations=None, random_state=None, correlation_matrix = None): """ Generate a latin-hypercube design @@ -41,6 +44,8 @@ (Default: 5). randomstate : np.random.RandomState, int Random state (or seed-number) which controls the seed and random draws + correlation_matrix : ndarray + Enforce correlation between factors (only used in lhsmu) Returns ------- @@ -109,7 +114,7 @@ if criterion is not None: if not criterion.lower() in ('center', 'c', 'maximin', 'm', 'centermaximin', 'cm', 'correlation', - 'corr'): + 'corr','lhsmu'): raise ValueError('Invalid value for "criterion": {}'.format(criterion)) else: @@ -129,6 +134,9 @@ H = _lhsmaximin(n, samples, iterations, 'centermaximin', random_state) elif criterion.lower() in ('correlation', 'corr'): H = _lhscorrelate(n, samples, iterations, random_state) + elif criterion.lower() in ('lhsmu'): + # as specified by the paper. M is set to 5 + H = _lhsmu(n, samples, correlation_matrix, random_state, M=5) return H @@ -201,9 +209,69 @@ for i in range(iterations): # Generate a random LHS Hcandidate = _lhsclassic(n, samples, randomstate) - R = np.corrcoef(Hcandidate) + R = np.corrcoef(Hcandidate.T) if np.max(np.abs(R[R!=1]))<mincorr: mincorr = np.max(np.abs(R-np.eye(R.shape[0]))) H = Hcandidate.copy() return H + + ################################################################################ + +def _lhsmu(N, samples=None, corr=None, random_state=None, M=5): + + if random_state is None: + random_state = np.random.RandomState() + elif not isinstance(random_state, np.random.RandomState): + random_state = np.random.RandomState(random_state) + + if samples is None: + samples = N + + I = M*samples + + rdpoints = random_state.uniform(size=(I, N)) + + dist = spatial.distance.cdist(rdpoints, rdpoints, metric='euclidean') + D_ij = ma.masked_array(dist, mask=np.identity(I)) + + index_rm = np.zeros(I-samples, dtype=int) + i = 0 + while i < I-samples: + order = ma.sort(D_ij, axis=1) + + avg_dist = ma.mean(order[:, 0:2], axis=1) + min_l = ma.argmin(avg_dist) + + D_ij[min_l, :] = ma.masked + D_ij[:, min_l] = ma.masked + + index_rm[i] = min_l + i += 1 + + rdpoints = np.delete(rdpoints, index_rm, axis=0) + + if(corr is not None): + #check if covariance matrix is valid + assert type(corr) == np.ndarray + assert corr.ndim == 2 + assert corr.shape[0] == corr.shape[1] + assert corr.shape[0] == N + + norm_u = stats.norm().ppf(rdpoints) + L = linalg.cholesky(corr, lower=True) + + norm_u = np.matmul(norm_u, L) + + H = stats.norm().cdf(norm_u) + else: + H = np.zeros_like(rdpoints, dtype=float) + rank = np.argsort(rdpoints, axis=0) + + for l in range(samples): + low = float(l)/samples + high = float(l+1)/samples + + l_pos = rank == l + H[l_pos] = random_state.uniform(low, high, size=N) + return H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyDOE2-1.1.2/pyDOE2.egg-info/PKG-INFO new/pyDOE2-1.3.0/pyDOE2.egg-info/PKG-INFO --- old/pyDOE2-1.1.2/pyDOE2.egg-info/PKG-INFO 2018-11-13 09:04:44.000000000 +0100 +++ new/pyDOE2-1.3.0/pyDOE2.egg-info/PKG-INFO 2020-01-27 12:37:39.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: pyDOE2 -Version: 1.1.2 +Version: 1.3.0 Summary: Design of experiments for Python Home-page: https://github.com/clicumu/pyDOE2 Author: Rickard Sjoegren @@ -151,3 +151,4 @@ Classifier: Topic :: Software Development :: Libraries Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Utilities +Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyDOE2-1.1.2/setup.cfg new/pyDOE2-1.3.0/setup.cfg --- old/pyDOE2-1.1.2/setup.cfg 2018-11-13 09:04:44.000000000 +0100 +++ new/pyDOE2-1.3.0/setup.cfg 2020-01-27 12:37:40.000000000 +0100 @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyDOE2-1.1.2/setup.py new/pyDOE2-1.3.0/setup.py --- old/pyDOE2-1.1.2/setup.py 2018-11-13 09:02:30.000000000 +0100 +++ new/pyDOE2-1.3.0/setup.py 2020-01-27 12:37:04.000000000 +0100 @@ -7,13 +7,14 @@ setup( name='pyDOE2', - version="1.1.2", + version="1.3.0", author='Rickard Sjoegren', author_email='[email protected]', description='Design of experiments for Python', url='https://github.com/clicumu/pyDOE2', license='BSD License (3-Clause)', long_description=read('README.md'), + long_description_content_type='text/markdown', packages=['pyDOE2'], install_requires=['numpy', 'scipy'], keywords=[
