Closed knaaptime closed 5 years ago
I've seen that products is a branch of cenpy, right?
i added a note. you can either use the github version of cenpy and checkout the products branch, or you can test out the first alpha with pip install --pre cenpy
Ok, cool, I managed to install the pre-version, but when I run the third cell I get:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-5-b813ef537da5> in <module>()
----> 1 atl = products.ACS(2017).from_msa(name='Atlanta, GA', variables=variables.copy(), level='tract')
~\AppData\Local\Continuum\anaconda3\lib\site-packages\cenpy\products.py in from_msa(self, name, variables, level, **kwargs)
357 def from_msa(self, name, variables=None, level='tract', **kwargs):
358 return self._from_name(name, variables, level,
--> 359 'Metropolitan Statistical Area', '_msas', **kwargs)
360 from_msa.__doc__ = _Product.from_place.__doc__.replace('place', 'MSA')
361 def from_csa(self, name, variables=None, level='tract', **kwargs):
~\AppData\Local\Continuum\anaconda3\lib\site-packages\cenpy\products.py in _from_name(self, place, variables, level, layername, cache_name, strict_within, return_bounds, geometry_precision)
326 strict_within=True,
327 return_bounds=False, geometry_precision=2):
--> 328 if level not in self._layer_lookup().keys():
329 raise NotImplementedError('Only levels {} are supported. You provided {}.'
330 'Try picking the state containing that level,'
TypeError: 'dict' object is not callable
Trying to debug here.. this must have something to do with from_msa
from these functions: https://github.com/ljwolf/cenpy/blob/product/cenpy/products.py
that's been fixed upstream if you use the github version
hm... so I reinstalled cenpy running pip install --pre cenpy
and then from cenpy import products
worked smoothly... what would be the github version in this case?
the products
branch has an early RC available on pip using the --pre
flag, but that release has a small bug in the _from_msa
method. That bug is fixed upstream in @ljwolf's repo, so to use it you
git checkout products
python setup.py develop
(note that since you're using the develop command, the version you import will change depending on which branch you have checked out)the
products
branch has an early RC available on pip using the--pre
flag, but that release has a small bug in the_from_msa
method. That bug is fixed upstream in @ljwolf's repo, so to use it you
- uninstall any cenpy's you currently have
- clone https://github.com/ljwolf/cenpy.git
git checkout products
python setup.py develop
(note that since you're using the develop command, the version you import will change depending on which branch you have checked out)
Ow, I see, thanks! I'll try here!
It worked! Thank you! :) I'm gonna try to reproduce now! (I'm downloading the network...)
were you able to reproduce?
So, I still didn't reproduce the notebook on my side (I'll keep trying), but I think this is good to be merged will some small tweaks:
update comment of cenpy (perhaps also adding the python setup.py develop part) to be before call on the first cell
Is there a way to add an external link for the source for the list of the variables names in the notebook? For example, if the user wanted to change the group (other than black, white, hispanic, asian) where could he find the respective codes?
add an additional comment that calc.access could take some time to run (similar to the comment on downloading network)
change "balt" on :
# balt_network.save_hdf5('atl_network.h5')
excellent, thanks
No sweat! Ow, also consider using the recent Multi_Information_Theory
class for the last function. I wanted to check if the values were matching.
EDIT: I checked here and, indeed, the values matched:
I think I managed to run the notebook reducing the buffer to 1000. Since this is a tutorial notebook for explaining functions, could we change this parameter?
Also, shouldn't nbsit
function should be run in atl_access
instead of atl
? I think with the latter it is building the aspatial version of the index, isn't it?
lol yeah, oops. I had both in there for comparison (the stats are quite different) but apparently deleted the wrong cell when I tried to simplify. Good catch
Also, geopandas is being imported two times. I think you can drop one.
Awesome, thanks for adding these new functionalities, @knaaptime !
Cool! This notebook is a huge improvement! I'm trying to reproduce the notebook here and am getting this from cenpy (do you know what might be happening?):