pysal / esda

statistics and classes for exploratory spatial data analysis
https://pysal.org/esda
BSD 3-Clause "New" or "Revised" License
206 stars 53 forks source link

add interactive plot for local moran #274

Closed knaaptime closed 8 months ago

knaaptime commented 8 months ago
codecov[bot] commented 8 months ago

Codecov Report

Merging #274 (2f557f2) into main (f6a8732) will increase coverage by 0.2%. The diff coverage is 97.4%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #274     +/-   ##
=======================================
+ Coverage   73.4%   73.6%   +0.2%     
=======================================
  Files         24      24             
  Lines       3285    3316     +31     
  Branches     518     520      +2     
=======================================
+ Hits        2411    2441     +30     
  Misses       708     708             
- Partials     166     167      +1     
Files Coverage Δ
esda/moran.py 76.0% <97.4%> (+1.5%) :arrow_up:
knaaptime commented 8 months ago

actually, it might be nice to just expose a method that returns cluster labels at a given threshold

martinfleis commented 8 months ago

How do you like to do the folium tests @martinfleis ?

Get html string and look for expected strings in that. Check geopandas explore tests, there are some helper functions to get that out of the m.

I'll have a look at the PR later. Ping me if you'll need some input sooner.

knaaptime commented 8 months ago

appreciate it. It's coming back to me now as i'm remembering i already asked you for the local knox plots :P

knaaptime commented 8 months ago

this is ready, though not sure why the non-numba tests are failing

jGaboardi commented 8 months ago

Seem to be failing due to dtype mismatch:

E           Mismatched elements: 1 / 10 (10%)
E            x: array(['Insignificant', 'Insignificant', 'Insignificant', 'Insignificant',
E                  'Insignificant', 'Insignificant', 'Insignificant', 'Insignificant',
E                  'Insignificant', 'Insignificant'], dtype=object)
E            y: array(['Insignificant', 'Insignificant', 'Insignificant', 'Insignificant',
E                  'Insignificant', 'Insignificant', 'High-High', 'Insignificant',
E                  'Insignificant', 'Insignificant'], dtype='<U13')
knaaptime commented 8 months ago

@jGaboardi yeah thats weird but the vals are different too. the y array has a high-high

jGaboardi commented 8 months ago

@jGaboardi yeah thats weird but the vals are different too. the y array has a high-high

good point; missed that part.

knaaptime commented 8 months ago

my guess would be something to do with the seeding

knaaptime commented 8 months ago

@martinfleis that would be great if you have a sec, but no sweat if not. I dunno why these are failing. Also if you think we should beef up the second map test a bit instead of just checking number of layers

martinfleis commented 8 months ago

I meant the actual coverage of the results, to check the html string for colours. Haven't actually looked at failures. But won't happen sooner than tomorrow eve.

knaaptime commented 8 months ago

yeah that would be great too. Though i think coverage should be decent once we're passing again

martinfleis commented 8 months ago

I have added a small commit checking the correctness of the folium html.

martinfleis commented 8 months ago

It seems that the result is stable on larger data. Maybe use Sacramento to test labels as well?

knaaptime commented 8 months ago

yeah, i'll just do that. Upping the number of permutations might do the trick too. Though its a little curious that all the numba-based tests are passing but the non-numba arent. I'm not sure what that implies about the seeding