Migrate to pysepal 4.0 - #24
Merged
Merged
Conversation
vectortileserver 0.2.2 binds 127.0.0.1 and resolves tippecanoe next to the interpreter itself, so the app no longer patches around either. Removing the PATH mutation exposed that the GDAL CLI lookup had the same problem, and was only ever fixed by that side effect -- and only when points happened to be rendered first, so a second raster upload took a different code path than the first. Resolve the GDAL tools the same way instead.
Categorical rendering was never app-specific: the discrete LUT, the server-side registration that keeps per-class alpha, and the COG preparation now live in SepalMap.add_raster behind class_colors. SbaeMap just inherits it, so the local add_class_raster, _optimize_for_tiles, _build_class_colormap and scripts/tiling.py all go, and the inert LOCALTILESERVER_HOST knob goes with the TileClient call that carried it. classification_layer was assigned twice and read nowhere; dropped. Needs pysepal 3.9.0.
Renames the sepal_ui imports, moves theme onto ThemeState, and drops the local comm-bridge component: localtileserver 1.0 stands up jupyter-loopback itself, so the transport is decided by LOCALTILESERVER_CLIENT_PREFIX. Copy that route to vectortileserver, which never autodetects one, or the PMTiles points silently never load on SEPAL.
The tiled COG and the class palette are produced by two independent async paths. When the COG won the race the raster was added with an empty palette, so every class rendered down the dark end of the default continuous ramp -- silently, and permanently, since the status latched to "finished" and the layer was never redrawn. Gate the add on the palette instead, and clear it with the rest of the file state so the next raster cannot inherit it.
A vector upload computed areas fine, then tried to show the file with add_raster, which opens with rasterio and raised RasterioIOError out of a use_effect. Only rasters are supported, so reject them at selection and drop the branch that drew them.
This was referenced Aug 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the app onto pysepal 4.0 and folds in the tile band-aid cleanup that was
split across #20, #22 and #23, which this replaces.
v4 deletes the
sepal_uipackage, so every import is renamed; theme moves fromper-widget
ThemeToggleto a scope-keyedThemeState, threaded through thecharts; and the local comm-bridge component is gone, because localtileserver 1.0
stands up jupyter-loopback itself and
LOCALTILESERVER_CLIENT_PREFIXdecides thetransport. SEPAL sets that prefix, so
app.pycopies it toVECTORTILESERVER_CLIENT_PREFIXtoo -- vectortileserver never autodetects one,and without it the PMTiles points silently never load.
Two bugs surfaced while testing on a sandbox and are fixed here. The class
palette and the tiled COG are produced by independent async paths, and when the
COG won the race the raster was drawn with an empty palette -- every class down
the dark end of the default ramp, permanently, since the status latched. And a
vector upload crashed the map effect with
RasterioIOError; only rasters aresupported, so they are now rejected at selection.
Tested locally and on a SEPAL sandbox under both Voila and Jupyter: class raster,
PMTiles points, dark theme and the full analysis all render. 201 tests pass.
pysepal is unblocked: 4.0.0rc0 is on PyPI, and the pin now reads
pysepal>=4.0.0rc0. The floor names the pre-release deliberately, since pip onlyconsiders one when the specifier itself mentions one -- plain
>=4.0.0matchednothing at all and the environment failed to resolve. Every symbol this branch
imports resolves against the rc,
add_rastertakesclass_colors, and the wheelships no
sepal_ui.Still blocked on vectortileserver 0.2.2. The loopback bind and the tippecanoe
lookup are merged upstream, but the version string is still 0.2.1 and nothing
above 0.2.1 is on PyPI, so
vectortileserver>=0.2.2keeps CI from resolving theenvironment until that release goes out.