You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
pysat.utils.listify([])
See error
From unit testing
iterable = []
def listify(iterable):
"""Returns a flattened list of iterable if not already a list
Parameters
----------
iterable : iter-like
An iterable object that will be wrapped within a list
Returns
-------
list
An enclosing 1-D list of iterable if not already a list
"""
arr_iter = np.asarray(iterable)
if arr_iter.shape == ():
list_iter = [arr_iter.tolist()]
elif arr_iter.shape[0] >= 1:
list_iter = arr_iter.flatten().tolist()
> return list_iter
E UnboundLocalError: local variable 'list_iter' referenced before assignment
Expected behavior
Should work fine.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: macOS
Version python 3.7
Other details about your setup that could be relevant
Additional context
As is, code will break on any input that doesn't match the two checks.
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
From unit testing
Expected behavior
Should work fine.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
As is, code will break on any input that doesn't match the two checks.
The text was updated successfully, but these errors were encountered: