-
Notifications
You must be signed in to change notification settings - Fork 34
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] data duplication on save (maybe render?) #725
Comments
Even creating import geodatasets
import geopandas as gpd
from lonboard import Map, PolygonLayer
gdf = gpd.read_file(geodatasets.get_path("geoda.milwaukee1"))
gdf = gdf[["HH_INC", "geometry"]]
## uncomment to get larger file:
# for i in range(5):
# PolygonLayer.from_geopandas(gdf)
Map([PolygonLayer.from_geopandas(gdf)]).to_html("test.html") |
So what I think is causing the issue is that |
Thanks for tracking that down! Would you be able to test out #726? |
@kylebarron I've run the same code on your branch and it the file size stays consistent at 3MB 👍 If a program generates a lot of these files in a loop, it's still going to leak memory, but that seems like a known ipywidgets issue (jupyter-widgets/ipywidgets#1345). The ticket suggests a workaround – explicitly closing down widgets when we're done with them – but that's tedious and error-prone. |
Context
if i create several independent
Map
s and write each out to file, each successive file contains all of the data from prior maps until the kernel is restartedResulting behaviour, error message or logs
every map after the first contains data from all prior maps
Environment
macos 15
geopandas : 1.0.1
geodatasets: 2024.8.0
lonboard : 0.10.3
Steps to reproduce the bug
reproducible example. This will write 5 test files, the first of which is 3.3mb, the last of which is 16.7
maybe this is anywidget related? I'm pretty sure this happens each time a map is rendered, not necessarily each time its written to file. If you recreate a bunch of maps in the same notebook (as in re-run the cells, not generate a billion maps) it will blow up the RAM and eventually crash the kernel
The text was updated successfully, but these errors were encountered: