tisimst / pyDOE

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

Python 3 numpy warnings #11

Open willblatt opened 6 years ago

willblatt commented 6 years ago

In Python 3.6.0, numpy 1.11.3, the following warnings appear:

C:\Users\######\AppData\Local\Continuum\Anaconda3\lib\site-packages\pydoe-0.3.8-py3.6.egg\pyDOE\doe_repeat_center.py:43: VisibleDep
recationWarning: using a non-integer number instead of an integer will result in an error in the future
.C:\Users\######\AppData\Local\Continuum\Anaconda3\lib\site-packages\pydoe-0.3.8-py3.6.egg\pyDOE\doe_factorial.py:78: VisibleDeprec
ationWarning: using a non-integer number instead of an integer will result in an error in the future

At least one of them appears to be due to this line in bbdesign: nb_lines = (n*(n-1)/2)*H_fact.shape[0]

NicolasDumoulin commented 6 years ago

This line throws an error on my jupyter notebook (docker jupyter/minimal-notebook). notebook server 5.0.0 Python 3.5.2 IPython 6.1.0

In [2]: ff2n(3)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-7-a3c6381f1eac> in <module>()
----> 1 ff2n(3)

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

/opt/conda/lib/python3.5/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: 'numpy.float64' object cannot be interpreted as an integer
NicolasDumoulin commented 6 years ago

Fixed by using willblatt's fork: pip install git+https://github.com/willblatt/pyDOE Thanks

swryan commented 6 years ago

FWIW: I have found that there is now a pyDOE2 on pypi that is being maintained

chengzhan commented 6 years ago

Glad to see that pyDOE2 is available!!