Refactor user guide notebooks 10-31 to standard structure#1003
Merged
brendancol merged 42 commits intomasterfrom Mar 13, 2026
Merged
Refactor user guide notebooks 10-31 to standard structure#1003brendancol merged 42 commits intomasterfrom
brendancol merged 42 commits intomasterfrom
Conversation
Restructure 14_Dasymetric_Mapping.ipynb to match the standard user guide format. Add coverage for pycnophylactic interpolation and validate_disaggregation. Replace raw ax.imshow with DataArray.plot.imshow, add legends and colorbars, include alert boxes, and close with a four-method comparison panel.
Restructure to standard cell layout. Replace ax.imshow with DataArray.plot.imshow, add colorbars, fix colorblind-unsafe green/red pair, add GIS alert boxes, generate preview image.
Restructure to standard cell layout. Replace raw imshow with DataArray.plot.imshow, add colorbars and legends, include GIS alert boxes, generate preview image.
Restructure to standard cell layout. Replace raw imshow with DataArray.plot.imshow, add colorbars and legends, include GIS alert boxes for HAND thresholds and CN limitations, generate preview image.
Restructure to standard cell layout. Replace raw imshow with DataArray.plot.imshow, fix red/green colormap, add legends and colorbars, include GIS alert boxes, generate preview image.
Restructure to standard cell layout. Replace raw imshow with DataArray.plot.imshow, add colorbars and legends, include GIS alert boxes, generate preview image.
Restructure to match the standard user guide template: title with module name, preview image, nav links, hillshade overlays using xr.DataArray.plot.imshow, Patch legends, GIS alert boxes for radius units and slope units, and a References section. Data generation switched from hand-rolled Gaussians to generate_terrain for consistency with other notebooks.
Restructure 20_Water_Indices.ipynb to match the standard user guide format: title/subtitle, preview image, standard imports, single data generation cell, individual analysis sections with legends and GIS alert boxes, and a references section. Replace raw ax.imshow calls with xr.DataArray.plot.imshow, add a more interesting synthetic scene with a lake and river channel, and include a water mask overlay section.
Restructure to standard cell layout. Replace raw imshow with DataArray.plot.imshow, add colorbars and legends, include GIS alert boxes, generate preview image.
Restructure the notebook to match the standard user guide format: generate_terrain with hillshade overlays, plot.imshow throughout, GIS alert boxes for edge handling and kernel sizing, circular vs square kernel comparison with legend, and a preview image.
Restructure to match the standard user guide template: title with subtitle, "What you'll build" preview, consolidated data generation, hillshade overlays, plot.imshow throughout, GIS alert boxes for edge effects and sigma_range selection, cross-section plot with colorblind- safe palette, and references section.
Restructure the notebook into the established cell sequence: title with subtitle, what-you'll-build overview with preview image and nav links, imports, data section, then individual analysis sections each with markdown intro, code, and optional alerts. Replace all raw ax.imshow calls with xr.DataArray.plot.imshow. Add legends to overlay plots, swap magma for inferno on variance maps, and add GIS alert boxes covering variance interpretation and ordinary vs universal kriging. Generate a preview image saved to images/kriging_preview.png.
Restructure to standard cell layout with title/subtitle, what-you'll-build, and section pattern. Replace ax.imshow with DataArray.plot.imshow, add source markers and legends, switch to inferno colormap, add GIS alert boxes for threshold units and corridor-vs-pathfinding, add references.
Restructure to standard cell layout. Replace ax.imshow with DataArray.plot.imshow, use coolwarm for difference maps, add colorbar labels, include parameter sensitivity and GPU alert boxes, add references.
Restructure to standard cell layout. Replace bare .plot() with DataArray.plot.imshow, add colorbar labels, include resolution alert box, add references.
Restructure to standard cell layout. Replace ax.imshow with DataArray.plot.imshow, add colorbars and legends, include gray levels alert box, add references.
Restructure to standard cell layout. Replace ax.imshow with DataArray.plot.imshow, add hillshade overlays, remove accessor demo, add references.
Restructure to standard cell layout. Replace ax.imshow with DataArray.plot.imshow, fix cell ordering, add routing model comparison alert box, add references.
plt.show() triggers a UserWarning on non-interactive backends (nbconvert, papermill). Jupyter's inline backend renders figures automatically without it.
Remove matplotlib.use('Agg') which blocks inline rendering in Jupyter.
Add %matplotlib inline magic to all notebooks. Fix savefig paths and
add pathlib.Path('images').mkdir() guards. Fix broken try/except in
notebook 19. Re-execute all notebooks to generate plot outputs.
Ellipse width is rotated by angle, so it needs to match the major eigenvalue. Reversed eigvals order so the major axis aligns with the major eigenvector direction.
Red X markers for original hand-placed points, blue dots for snapped positions on channels. Updated preview image to match.
Increase marker size to s=200, use yellow stars for snapped points and red X's for originals with black edges for contrast against the watershed colors.
scatter() was using raw row/col indices while plot.imshow() uses DataArray x/y coordinates. Convert indices to data coords so the markers land on the correct raster cells.
Dilate flow paths to 3px width, use neon colormap on dark background with muted hillshade for high-contrast path visibility.
Add half-pixel offset to scanline edge extraction so integer positions correspond to pixel centers instead of edges. Re-execute notebooks 10, 23-31 to capture updated outputs.
Drop terrain colormap drape from basemap (hillshade only), use white backgrounds for flow accumulation plots, raise overlay alpha so data layers read clearly against a single neutral base.
Remove terrain colormap drape, use hillshade-only basemap, raise overlay alpha, and use cleaner sequential colormaps for depth/HAND/ travel time so data reads clearly against the neutral gray base.
contours() returned raw array indices, which produced misaligned contour lines when plotted on xarray imshow axes that use the DataArray's coordinate values. Transform output coordinates from array indices to the DataArray's y/x coordinate space via np.interp. Update tests, contour_explorer, and user guide notebook accordingly.
…outputs Switch 24_Sky_View_Factor from hand-crafted sinusoidal terrain to generate_terrain with ridged noise and domain warping. Add overlay blend composite panel showing hillshade + SVF together. Clear outputs from all user guide notebooks.
Zero-weight pixels (water, parks) were absorbing leftover population during the overflow pass. Set class-0 density cap to 0 by default and restrict overflow distribution to habitable pixels only. Expose class_breaks and density_caps parameters on the public disaggregate API.
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.
Summary
matplotlib.use('Agg')overrides andplt.show()calls that broke inline output in Jupyter)np.linalg.eigh)Test plan
jupyter nbconvert --execute(all 22 pass on this branch)images/)