Skip to content

Conversation

@slumnitz
Copy link
Member

test and documentation for rose.plot() and rose.plot_vectors()

added tests
added documentation
added DeprecationWarning
added splot install to .travis.yml

@slumnitz slumnitz changed the title Tests ad documentation for rose.plot() and rose.plot_vectors() Tests and documentation for rose.plot() and rose.plot_vectors() Jul 2, 2018
update documentation no coloring option `attribute` in `.plot_vectors()`
warnings.warn('This method relies on importing `splot` in future',
DeprecationWarning)

if use_splot:
Copy link
Member

@ljwolf ljwolf Jul 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the import fails, then you'll see the warning in line 388, and then this will fail on a name error.

This happens because use_splot isn't defined by the time you hit this if.

I think you can solve this if you set use_splot=False after line 389

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the current model of splot in terms of supporting visualization for other pysal packages such as giddy and esda. My thought was that giddy would only focus on analytics while leaving visualization to splot, meaning that giddy would not have a plot function but users can easily import splot when visualization is needed. We can also demonstrate the visualization functionalities provided by splot in jupyter notebook gallery. (splot and geopandas will be included in the requirement_dev.txt to support sphinx building) In this way, giddy will be a lightweight package.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weikang9009 the idea was that the plotting functionality remains in splot and can be called as a .plot() method inside other sub packages. This makes plotting specific objects more user friendly. I will change the import/ install requirement of splot to make it a soft-dependency so giddy remains a lightweight package with a plotting option if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I apologize to @weikang9009 as I didn't convey the splot based discussions that led to the this pr and its potential implications for giddy.

Not sure this creates any weight for giddy as splot is treated as a soft dependency here.

I am +1 on adding the plot method as I think it makes sense for the designers of giddy to suggest the default analytical plots. Again, it is based on a soft dependency so we don't increase the install requirements, but give the interested user warnings if they try the plot method without splot installed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification.

warnings.warn('This method relies on importing `splot` in future',
DeprecationWarning)

if use_splot:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here as the rose plot

fig, _ = rose.plot(attribute=y1)
plt.close(fig)


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these need to use an @unittest.skipIf decorator, unless @weikang9009 and @sjsrey are fine with adding geopandas as a development dependency for giddy.

I think it's fine, but I'm not a giddy maintainer 😄

- conda install --yes pip
- conda install --yes nose
- pip install -r requirements.txt
- pip install libpysal esda mapclassify
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libpysal, esda and mapclassify are included in requirements.txt now

warnings.warn('This method relies on importing `splot` in future',
DeprecationWarning)

if use_splot:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the current model of splot in terms of supporting visualization for other pysal packages such as giddy and esda. My thought was that giddy would only focus on analytics while leaving visualization to splot, meaning that giddy would not have a plot function but users can easily import splot when visualization is needed. We can also demonstrate the visualization functionalities provided by splot in jupyter notebook gallery. (splot and geopandas will be included in the requirement_dev.txt to support sphinx building) In this way, giddy will be a lightweight package.

@sjsrey sjsrey merged commit 92fcbd0 into pysal:master Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants