Skip to content

Commit f91975a

Browse files
committed
Use pydoe instead of archived pyDOE3
1 parent 4533105 commit f91975a

13 files changed

Lines changed: 47 additions & 47 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ To cite SMT legacy: M. A. Bouhlel and J. T. Hwang and N. Bartoli and R. Lafage a
4444

4545
# Required packages
4646

47-
SMT depends on the following modules: numpy, scipy, scikit-learn, pyDOE3 and Cython.
47+
SMT depends on the following modules: numpy, scipy, scikit-learn, pydoe and Cython.
4848

4949
# Installation
5050

doc/_src_docs/sampling_methods/lhs.rst

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/_src_docs/sampling_methods/lhs.rstx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Latin Hypercube sampling
44
The LHS design is a statistical method for generating a quasi-random sampling distribution. It is among the most popular sampling techniques in computer experiments thanks to its simplicity and projection properties with high-dimensional problems. LHS is built as follows: we cut each dimension space, which represents a variable, into n
55
sections where n is the number of sampling points, and we put only one point in each section.
66

7-
The LHS method uses the pyDOE package (Design of Experiments for Python) [1]_. Five criteria for the construction of LHS are implemented in SMT:
7+
The LHS method uses the pydoe package (Design of Experiments for Python) [1]_. Five criteria for the construction of LHS are implemented in SMT:
88

99
- Center the points within the sampling intervals.
1010
- Maximize the minimum distance between points and place the point in a randomized location within its interval.
1111
- Maximize the minimum distance between points and center the point within its interval.
1212
- Minimize the maximum correlation coefficient.
1313
- Optimize the design using the Enhanced Stochastic Evolutionary algorithm (ESE).
1414

15-
The four first criteria are the same than in pyDOE (for more details, see [1]_). The last criterion, ESE, is implemented by the authors of SMT (more details about such method could be found in [2]_).
15+
The four first criteria are the same than in pydoe (for more details, see [1]_). The last criterion, ESE, is implemented by the authors of SMT (more details about such method could be found in [2]_).
1616

17-
.. [1] https://pydoe3.readthedocs.io/en/stable
17+
.. [1] https://pydoe.github.io/pydoe/
1818

1919
.. [2] Jin, R. and Chen, W. and Sudjianto, A. (2005), "An efficient algorithm for constructing optimal design of computer experiments." Journal of Statistical Planning and Inference, 134:268-287.
2020

doc/_src_docs/sampling_methods/pydoe.rst

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/_src_docs/sampling_methods/pydoe.rstx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
pyDOE sampling methods
1+
pydoe sampling methods
22
======================
33

4-
pyDOE is a package for design of experiments [1]_ (LHS implementation in SMT is based on pyDOE LHS).
4+
pydoe is a package for design of experiments [1]_ (LHS implementation in SMT is based on pydoe LHS).
55

6-
Main DOE functions provided by pyDOE are made available through an adapter base
6+
Main DOE functions provided by pydoe are made available through an adapter base
77
class `PyDoeSamplingMethod` which makes them compliant with the `SamplingMethod` base class interface.
88

9-
While historically the sampling method interface of SMT requires to specify a number of points, pyDOE design
9+
While historically the sampling method interface of SMT requires to specify a number of points, pydoe design
1010
methods output a number of points which is only determined by the dimension of x and other method-specific options.
1111

1212
The following designs are exposed:
@@ -16,13 +16,13 @@ The following designs are exposed:
1616
* Factorial design
1717
* Generalized Subset Design
1818

19-
See pyDOE3 documentation [2]_
19+
See pydoe documentation [2]_
2020

2121
References
2222

23-
.. [1] https://github.com/relf/pyDOE3
23+
.. [1] https://github.com/pydoe/pydoe
2424

25-
.. [2] https://pydoe3.readthedocs.io/en/stable
25+
.. [2] https://pydoe.github.io/pydoe/
2626

2727

2828
Box Behnken sampling

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ packaging
33
numpy
44
scipy
55
scikit-learn
6-
pyDOE3 >= 1.5.0
6+
pydoe >= 1.0.0, <2.0
77
numpydoc
88
matplotlib
99
jenn >= 2.0.0, <3.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
dependencies = [
2929
"packaging",
3030
"scikit-learn",
31-
"pyDOE3>=1.5.0",
31+
"pydoe>=1.0.0,<2.0",
3232
"scipy",
3333
"jenn>=2.0.0,<3.0",
3434
]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ packaging
33
numpy
44
scipy
55
scikit-learn
6-
pyDOE3 >= 1.5.0
6+
pydoe >= 1.0.0, <2.0
77
numba # JIT compiler
88
matplotlib # used in examples and tests
99
pytest # tests runner

smt/sampling_methods/lhs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
44
This package is distributed under New BSD license.
55
6-
LHS sampling; uses the pyDOE3 package.
6+
LHS sampling; uses the pydoe package.
77
"""
88

99
import numpy as np
10-
from pyDOE3 import lhs
10+
from pydoe import lhs
1111
from scipy.spatial.distance import cdist, pdist
1212

1313
from smt.sampling_methods.sampling_method import ScaledSamplingMethod

smt/sampling_methods/pydoe.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
44
This package is distributed under New BSD license.
55
6-
pyDOE3 sampling methods
6+
pydoe sampling methods
77
"""
88

99
import numpy as np
10-
from pyDOE3 import doe_box_behnken, doe_factorial, doe_gsd, doe_plackett_burman
10+
from pydoe import bbdesign, fullfact, gsd, pbdesign
1111

1212
from smt.sampling_methods.sampling_method import SamplingMethod
1313

1414

1515
class PyDoeSamplingMethod(SamplingMethod):
1616
"""
17-
Base class adapting pyDOE3 designs to SMT SamplingMethod interface
18-
See https://pydoe3.readthedocs.io/
17+
Base class adapting pydoe designs to SMT SamplingMethod interface
18+
See https://pydoe.github.io/pydoe/
1919
"""
2020

2121
def __init__(self, **kwargs):
@@ -25,14 +25,14 @@ def __init__(self, **kwargs):
2525

2626
def _compute(self, nt: int = None):
2727
"""
28-
Use pydoe3 design to produce [nsamples, nx] matrix
29-
where nsamples depends on the pyDOE3 method and nx is the dimension of x.
30-
Warning: In pyDOE3 design setting user requested number of points nt is not used
28+
Use pydoe design to produce [nsamples, nx] matrix
29+
where nsamples depends on the pydoe method and nx is the dimension of x.
30+
Warning: In pydoe design setting user requested number of points nt is not used
3131
"""
3232
xlimits = self.options["xlimits"]
3333
levels = self.levels
3434

35-
# Retrieve indices from pyDOE3 design
35+
# Retrieve indices from pydoe design
3636
doe = np.array(self._compute_doe(), dtype=int)
3737

3838
# Compute scaled values for each x components
@@ -66,7 +66,7 @@ def _compute_doe():
6666

6767

6868
class BoxBehnken(PyDoeSamplingMethod):
69-
"""See https://pydoe3.readthedocs.io/en/latest/rsm.html#box-behnken"""
69+
"""See https://pydoe.github.io/pydoe/rsm.html#box-behnken"""
7070

7171
def __init__(self, **kwargs):
7272
super().__init__(**kwargs)
@@ -76,11 +76,11 @@ def __init__(self, **kwargs):
7676

7777
def _compute_doe(self):
7878
# Increment Box Behnken levels to get indices [0, 1, 2]
79-
return doe_box_behnken.bbdesign(self.nx) + 1
79+
return bbdesign(self.nx) + 1
8080

8181

8282
class Gsd(PyDoeSamplingMethod):
83-
"""See https://pydoe3.readthedocs.io/en/latest/rsm.html#gsd"""
83+
"""See https://pydoe.github.io/pydoe/rsm.html#gsd"""
8484

8585
def __init__(self, **kwargs):
8686
super().__init__(**kwargs)
@@ -105,11 +105,11 @@ def _compute_doe(self):
105105
levels = self.options["levels"]
106106
reduction = self.options["reduction"]
107107

108-
return doe_gsd.gsd(levels, reduction)
108+
return gsd(levels, reduction)
109109

110110

111111
class Factorial(PyDoeSamplingMethod):
112-
"""See https://pydoe3.readthedocs.io/en/latest/factorial.html#general-full-factorial"""
112+
"""See https://pydoe.github.io/pydoe/factorial.html#general-full-factorial"""
113113

114114
def __init__(self, **kwargs):
115115
super().__init__(**kwargs)
@@ -125,11 +125,11 @@ def _initialize(self, **kwargs):
125125

126126
def _compute_doe(self):
127127
levels = self.options["levels"]
128-
return doe_factorial.fullfact(levels)
128+
return fullfact(levels)
129129

130130

131131
class PlackettBurman(PyDoeSamplingMethod):
132-
"""See https://pydoe3.readthedocs.io/en/latest/factorial.html#plackett-burman"""
132+
"""See https://pydoe.github.io/pydoe/factorial.html#plackett-burman"""
133133

134134
def __init__(self, **kwargs):
135135
super().__init__(**kwargs)
@@ -138,7 +138,7 @@ def __init__(self, **kwargs):
138138
self.levels = [2] * self.nx
139139

140140
def _compute_doe(self):
141-
doe = doe_plackett_burman.pbdesign(self.nx)
141+
doe = pbdesign(self.nx)
142142
# Change -1 level to get indices [0, 1]
143143
doe[doe < 0] = 0
144144

0 commit comments

Comments
 (0)