When using the unit meq/L in triangle_piper.py, lines 241 and 242 call for the use of variable dat which is only defined in preceeding if statements (starting line 206, on line 226) if unit is mg/l
Example:
triangle_piper.plot(df,unit='meq/L',figname='kbay_piper',figformat='jpg')
Error message:
UnboundLocalError Traceback (most recent call last)
in
1 from wqchartpy import rectangle_piper
----> 2 rectangle_piper.plot(df,unit='meq/L',figname='kbay_piper',figformat='jpg')
/usr/local/lib/python3.8/dist-packages/wqchartpy/rectangle_piper.py in plot(df, unit, figname, figformat)
105 sumcat = np.sum(meqL[:, 0:4], axis=1)
106 suman = np.sum(meqL[:, 4:], axis=1)
--> 107 cat = np.zeros((dat.shape[0], 3))
108 an = np.zeros((dat.shape[0], 3))
109 cat[:, 0] = meqL[:, 0] / sumcat # Ca
UnboundLocalError: local variable 'dat' referenced before assignment
When using the unit meq/L in triangle_piper.py, lines 241 and 242 call for the use of variable dat which is only defined in preceeding if statements (starting line 206, on line 226) if unit is mg/l
Example:
triangle_piper.plot(df,unit='meq/L',figname='kbay_piper',figformat='jpg')
Error message:
UnboundLocalError Traceback (most recent call last)
in
1 from wqchartpy import rectangle_piper
----> 2 rectangle_piper.plot(df,unit='meq/L',figname='kbay_piper',figformat='jpg')
/usr/local/lib/python3.8/dist-packages/wqchartpy/rectangle_piper.py in plot(df, unit, figname, figformat)
105 sumcat = np.sum(meqL[:, 0:4], axis=1)
106 suman = np.sum(meqL[:, 4:], axis=1)
--> 107 cat = np.zeros((dat.shape[0], 3))
108 an = np.zeros((dat.shape[0], 3))
109 cat[:, 0] = meqL[:, 0] / sumcat # Ca
UnboundLocalError: local variable 'dat' referenced before assignment