There's a decent amount of duplicate code to unpack database responses that should be generalized to make it easier to maintain and debug the functions. These functions should lie within a new file plpy_utils.py.
def get_attributes(resp, attr_max, attr_min=1):
return np.array([[x['attr{}'.format(str(i))] for x in resp]
for i in range(attr_min, attr_max+1)], dtype=float).transpose()
This is done in markov, non-spatial k-means, max-p, moran, GWR, spint...
There's a decent amount of duplicate code to unpack database responses that should be generalized to make it easier to maintain and debug the functions. These functions should lie within a new file
plpy_utils.py
.Given a
plpy.execute
response, formatted as:Gets unpacked by a function like this:
This is done in markov, non-spatial k-means, max-p, moran, GWR, spint...