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

[BUG] set viz defaults for LineStrings in lisa_cluster #140

Merged
merged 6 commits into from
Sep 27, 2021

Conversation

slumnitz
Copy link
Member

@slumnitz slumnitz commented Aug 5, 2021

  • add check for LineString on zeroeth index
  • change visualization defaults for gdf's with LineStrings
  • add tests

* different plotting defaults dependent on geom_type
splot/_viz_esda_mpl.py Outdated Show resolved Hide resolved
Comment on lines 222 to 234
def test_lisa_cluster():
df = _test_data_columbus()
moran_loc = _test_calc_moran_loc(df)

fig, _ = lisa_cluster(moran_loc, df)
plt.close(fig)

# test LineStrings
df_line = _test_LineString()
moran_loc = _test_calc_moran_loc(df_line)

fig, _ = lisa_cluster(moran_loc, df)
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.

Do you want to check the actual figure?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am definitely open to suggestions how the figure could be checked! :)

Copy link
Member

Choose a reason for hiding this comment

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

One option is to get the attributes from the plotted collection as we do in geopandas https://github.com/geopandas/geopandas/blob/64598b6f0d872baf09657c27a9aa4c87d86d9131/geopandas/tests/test_plotting.py#L169

The other is to keep a reference image in tests and check against that as matplotlib does in some cases https://github.com/matplotlib/matplotlib/blob/ec126b0175c657f0adb5ca635eeabad7c142bb0b/lib/matplotlib/tests/test_colorbar.py#L188-L190

@jGaboardi
Copy link
Member

@slumnitz @martinfleis Is this failing because the example data wasn't downloaded properly? Can we circle back and try to get this worked & merged?

@martinfleis
Copy link
Member

Is this failing because the example data wasn't downloaded properly?

No, the test was wrong. I've pushed a fix.

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2021

Codecov Report

Merging #140 (84e4211) into main (22039aa) will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #140      +/-   ##
==========================================
+ Coverage   85.94%   86.05%   +0.10%     
==========================================
  Files          18       18              
  Lines        1217     1226       +9     
==========================================
+ Hits         1046     1055       +9     
  Misses        171      171              
Impacted Files Coverage Δ
splot/_viz_esda_mpl.py 100.00% <100.00%> (ø)
splot/tests/test_viz_esda_mpl.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22039aa...84e4211. Read the comment docs.

@jGaboardi
Copy link
Member

@slumnitz This seems to be in good shape now (thanks to @martinfleis!). Would it be possible to get it merged, and a release cut & published to PyPI soon?

@martinfleis
Copy link
Member

release cut & published to PyPI soon

would be nice to get #143 in if we want a release.

@slumnitz
Copy link
Member Author

@martinfleis and @jGaboardi since I opened the PR, please take on the merge, so we practice non self-merging ;)

@martinfleis
Copy link
Member

Okay, I see the follow-up in #145 so merging. Thanks @slumnitz!

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

Successfully merging this pull request may close these issues.

4 participants