tisimst / pyDOE

Design of experiments for Python
BSD 3-Clause "New" or "Revised" License
263 stars 114 forks source link

bbdesign not working in python 3.8.5 #30

Open kakila opened 3 years ago

kakila commented 3 years ago

bbdesing is not working on Python 3.8.5

This is the error if I try to run the example in the docstring

----> 1 doe.bbdesign(3)

~/virtual_enviroments/hamopt/lib/python3.8/site-packages/pyDOE/doe_box_behnken.py in bbdesign(n, center)
     64 
     65     # First, compute a factorial DOE with 2 parameters
---> 66     H_fact = ff2n(2)
     67     # Now we populate the real DOE with this DOE
     68 

~/virtual_enviroments/hamopt/lib/python3.8/site-packages/pyDOE/doe_factorial.py in ff2n(n)
    113 
    114     """
--> 115     return 2*fullfact([2]*n) - 1
    116 
    117 ################################################################################

~/virtual_enviroments/hamopt/lib/python3.8/site-packages/pyDOE/doe_factorial.py in fullfact(levels)
     76         for j in range(levels[i]):
     77             lvl += [j]*level_repeat
---> 78         rng = lvl*range_repeat
     79         level_repeat *= levels[i]
     80         H[:, i] = rng

TypeError: can't multiply sequence by non-int of type 'numpy.float64'
manuel-masiello commented 3 years ago

Same Issue. You can test here: https://colab.research.google.com/drive/1paIe2xzREicgILvJSsE7PLlcRXbLNMJu#scrollTo=5rI7gtaEeDdp

francoisbres commented 2 years ago

with python 3, you have to install pydoe2 instead of pydoe

from pyDOE2 import fullfact, ff2n, fracfact, fold, pbdesign, bbdesign, ccdesign, lhs
bbdesign(3)
manuel-masiello commented 2 years ago

Hello @francoisbres thx for your help.

Yes. It's works using :

!pip install pyDOE2

from pyDOE2 import fullfact, ff2n, fracfact, fold, pbdesign, bbdesign, ccdesign, lhs
bbdesign(3)

Colab exemple: https://colab.research.google.com/drive/1paIe2xzREicgILvJSsE7PLlcRXbLNMJu?usp=sharing

Best, Manuel