Hi
I tried to run the apply_milpnet.py example and got the following error:
Traceback (most recent call last): File "C:\Users\User\Documents\GitHub\MILPNet\apply_milpnet.py", line 29, in <module> milpnet_results = run_gurobi(inp_file, no_ts, pump_on = False) File "C:\Users\User\Documents\GitHub\MILPNet\set_up_milpnet.py", line 689, in run_gurobi largest_q = max(np.max(results.link['flowrate'])) TypeError: 'numpy.float32' object is not iterable
The error points to set_up_milpnet.py line 689:
largest_q = max(np.max(results.link['flowrate']))
smallest_q = min(np.min(results.link['flowrate']))
It seems like there is a redundant max function
Where the first np.max returns a float\int and then the outer max fails to find the maximum of a scalar
Deleting the outer max and min solved this issue
Hi
I tried to run the
apply_milpnet.pyexample and got the following error:Traceback (most recent call last): File "C:\Users\User\Documents\GitHub\MILPNet\apply_milpnet.py", line 29, in <module> milpnet_results = run_gurobi(inp_file, no_ts, pump_on = False) File "C:\Users\User\Documents\GitHub\MILPNet\set_up_milpnet.py", line 689, in run_gurobi largest_q = max(np.max(results.link['flowrate'])) TypeError: 'numpy.float32' object is not iterableThe error points to
set_up_milpnet.pyline 689:largest_q = max(np.max(results.link['flowrate']))smallest_q = min(np.min(results.link['flowrate']))It seems like there is a redundant max function
Where the first
np.maxreturns a float\int and then the outermaxfails to find the maximum of a scalarDeleting the outer
maxandminsolved this issue