Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning when running spatial smoothing #111

Closed
KarenChen9999 opened this issue Apr 14, 2020 · 3 comments
Closed

DeprecationWarning when running spatial smoothing #111

KarenChen9999 opened this issue Apr 14, 2020 · 3 comments

Comments

@KarenChen9999
Copy link

KarenChen9999 commented Apr 14, 2020

I am running the example of spatial smoothing and got an error. I tested on pythong 2.7 and 3.7. Both are not working.

from pysal.esda import smoothing as sm
from pysal import knnW
sids = pysal.open(pysal.examples.get_path("sids2.shp"), 'r')
sids_d = np.array([i.centroid for i in sids])
sids_w = knnW(sids_d,k=5)
if not sids_w.id_order_set: sids_w.id_order = sids_w.id_order
triples = sm.Headbanging_Triples(sids_d,sids_w,k=5)

This is the error i got:

---------------------------------------------------------------------------
DeprecationWarning                        Traceback (most recent call last)
<ipython-input-10-5a0dd4e927b9> in <module>()
      4 sids_w = knnW(sids_d,k=5)
      5 if not sids_w.id_order_set: sids_w.id_order = sids_w.id_order
----> 6 triples = sm.Headbanging_Triples(sids_d,sids_w,k=5)

/apps/opt/anaconda3/envs/sm/lib/python2.7/site-packages/pysal/esda/smoothing.pyc in __init__(self, data, w, k, t, angle, edgecor)
   1688     """
   1689     def __init__(self, data, w, k=5, t=3, angle=135.0, edgecor=False):
-> 1690         raise DeprecationWarning('Deprecated. This function is no longer supported.')
   1691         if k < 3:
   1692             raise ValueError("w should be NeareastNeighbors instance & the number of neighbors should be more than 3.")

DeprecationWarning: Deprecated. This function is no longer supported.

Can anyone please suggest how to fix this?

@KarenChen9999 KarenChen9999 changed the title Error of DeprecationWarning when runnig spatial smoothing DeprecationWarning when running spatial smoothing Apr 14, 2020
@sjsrey
Copy link
Member

sjsrey commented Apr 14, 2020

Thanks for reporting the issue. We have deprecated that function as the original maintainer has left the project and the code is in need of refactoring for correctness. Until we have a new maintainer to work on this we have deprecated that specific piece of functionality.

@KarenChen9999
Copy link
Author

It seems that this function has been deprecated from old releases as well. The package i tried was 1.14.4. I thought this only occurred to the new release. Would be possible to get this function work for the old release?

@sjsrey
Copy link
Member

sjsrey commented Apr 15, 2020

I'm afraid, until we find a new maintainer to update and correct that functionality, we won't be supporting it.

@sjsrey sjsrey closed this as completed Apr 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants