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

module 'pysal.explore.spaghetti' has no attribute 'element_as_gdf' #323

Closed
TransUMD opened this issue Nov 7, 2019 · 12 comments
Closed

module 'pysal.explore.spaghetti' has no attribute 'element_as_gdf' #323

TransUMD opened this issue Nov 7, 2019 · 12 comments

Comments

@TransUMD
Copy link

TransUMD commented Nov 7, 2019

Describe the bug
module 'pysal.explore.spaghetti' has no attribute 'element_as_gdf'

To Reproduce
Running the example Spaghetti_Pointpatterns_Empirical.ipynb

@jGaboardi
Copy link
Member

@TransUMD, thanks for the report! I should be able to look into this in the next several days.

@TransUMD
Copy link
Author

TransUMD commented Nov 8, 2019

Thanks! One more information is that I install Pusan directly via pip install pysal. The raw code here have this function but I am not sure whether my version is right.

Thanks.

@jGaboardi
Copy link
Member

Do you mean pysal? (Maybe Pusan because of autocorrect).

import pysal
import spaghetti
print(pysal.__version__)
print(spaghetti.__version__)

Also, keep in mind that geopandas must be installed to be able to use element_as_gdf.

@TransUMD
Copy link
Author

TransUMD commented Nov 9, 2019

Hello,
Thanks for the prompt reply.

I do have geopandas installed in my computer.

The version of these are.

pysal: 2.0.0
spaghetii: 1.3.1
geopandas: 0.5.1

Thanks

@TransUMD
Copy link
Author

TransUMD commented Nov 9, 2019

It also happens to me when running:

counts = ntw.count_per_link(ntw.pointpatterns['crimes'].obs_to_arc,
graph=False)

I got:

'Network' object has no attribute 'count_per_link'

@jGaboardi
Copy link
Member

It sounds like you may have corrupted installation of spaghetti. Other than trying a fresh install of spaghetti, I am not sure how to troubleshoot this.

@sjsrey @ljwolf @weikang9009 Any suggestions here?

@TransUMD
Copy link
Author

TransUMD commented Nov 9, 2019

Thank you. I tried to install spaghetti separately and it works now by just import spaghetti.

Not sure why it does not work with: import pysal.explore.spaghetti

@jGaboardi
Copy link
Member

@TransUMD, this may very well be an issue with how we are bundling spaghetti into the full pysal metapackage. Thank you for bringing it to our attention! Let's keep this issue open here while I try to dig a bit deeper.

@TransUMD
Copy link
Author

TransUMD commented Nov 9, 2019

Thank you!

@weikang9009
Copy link
Member

@TransUMD @jGaboardi Maybe try installing the most recent version of pysal? (pysal 2.1.0)

pip install -U pysal

@jGaboardi
Copy link
Member

@weikang9009 good catch! I had missed that @TransUMD was working from pysal v2.0.0!

@TransUMD spaghetti v1.1.0 is included with pysal v2.0.0. This version of spaghetti does not include Network.element_as_gdf() and Network.count_per_link() was renamed from Network.count_per_edge().

@TransUMD
Copy link
Author

@weikang9009 Thanks. I re-install pysal and the problem is solved. Thank you all for the response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants