Skip to content

error using meq/l as unit in triangle or rectangle piper diagram #6

@SMunoz12

Description

@SMunoz12

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions