CODES-group / opyrability

Python-based Process Operability Package
MIT License
17 stars 3 forks source link

`OI_eval` breaks for 1D data due to `qhull` requirements #11

Open hunterbarber opened 7 months ago

hunterbarber commented 7 months ago

When space is 1D, OI_eval breaks due to

  File "...\shower_operability.py", line 24, in main
    OI = opy.OI_eval(TDS_region, EDS_bounds, perspective='inputs')
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\opyrability.py", line 423, in OI_eval 
    volumes_i.append(sp.spatial.ConvexHull(v_intersect).volume)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "_qhull.pyx", line 2431, in scipy.spatial._qhull.ConvexHull.__init__
  File "_qhull.pyx", line 279, in scipy.spatial._qhull._Qhull.__init__
ValueError: Need at least 2-D data
hunterbarber commented 7 months ago

Can be bypassed (or forced) by hypervol_calc='polytope' in OI_eval if sufficient for 1D problems