feat: MEE dashboards, component browser, map, sharing, and execution UI#8
Open
MaykThewessen wants to merge 16 commits intoPyPSA:mainfrom
Open
feat: MEE dashboards, component browser, map, sharing, and execution UI#8MaykThewessen wants to merge 16 commits intoPyPSA:mainfrom
MaykThewessen wants to merge 16 commits intoPyPSA:mainfrom
Conversation
Port Script_MEE-style dashboard analyses to pypsa-app as a new analysis service layer alongside the existing PyPSA built-in statistics. Adds 7 analysis types (dispatch_area, line_loading_histogram/timeseries, price_duration_curve/timeseries, cross_border_flows, capacity_mix) with canonical carrier colors, dispatch ordering, and country color theming. Performance: orjson for faster JSON serialization in cache and serializer, 128KB file hash chunks, NaN/Inf sanitization in DataFrame serialization, optional Polars for vectorized aggregations on large networks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
Fix critical bugs in analysis service:
- Replace unsafe n.buses.get("country", "") pattern that crashes on
networks without a "country" column (ValueError on pandas >= 2.0)
- Extract _get_bus_countries/_buses_in_country/_bus_country helpers
for safe, consistent country lookups across all analysis functions
- Add AC line cross-border flow detection (previously only HVDC links)
- Handle NaN country values gracefully
- Add .fillna(0) to capacity_mix reindex to prevent NaN bars
- Refactor cross_border_flows to reduce cyclomatic complexity (PLR0912)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…yPSA#6) Add two new analysis types addressing GitHub issue PyPSA#6: - nodal_balance: per-bus generation vs load at a given snapshot, showing net injection as overlay bar chart (top-N by absolute injection) - line_flow_snapshot: per-line loading % and flow direction at a given snapshot, with color-coded congestion thresholds Both support snapshot_idx parameter for time-step navigation, enabling the frontend to build a "grid playback" tool. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
Add full-stack component browser for viewing PyPSA network component data (buses, generators, lines, etc.) with pagination, sorting, search, and time-series metadata. Backend includes PATCH endpoint for editing component data with safe cache invalidation and path validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Edit mode with pencil toggle, batch save with yellow highlights for modified cells, confirm-on-discard for unsaved changes, and pagination/ sort disabled during editing to prevent data loss. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Users can save the current dashboard configuration (active tab, carrier/ country filters, individual plot mode) as named views, load them later, and share public views. Includes SavedView model, Alembic migration, CRUD API endpoints, and Save/Load UI in the network detail header. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Lightweight map visualization using Leaflet + OpenStreetMap tiles. Shows buses as circle markers and lines/links as colored polylines with capacity-based width. Popups show component details. Map auto-fits to network bounds and responds to carrier filter selection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
for more information, see https://pre-commit.ci
Networks can now be shared with specific users beyond public/private visibility. Adds network_shares join table, extends can_access() to check shares, adds share/unshare API endpoints, and includes a Share dialog in the network detail header with user search. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Form with workflow URL, branch/tag, config file, backend selection, and advanced options (snakemake args, import networks, visibility). Validates inputs, submits to API, and navigates to run detail on success. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix n.export() -> n.export_to_netcdf() (PyPSA has no .export()) - Add GET /networks/users/search endpoint for non-admin user search - Fix ShareDialog to use new endpoint instead of admin-only listUsers - Remove deadlock risk by dropping explicit cache lock acquisition Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
70631c7 to
56c73be
Compare
- Buses colored by carrier or country (toggle in legend panel) - Bus radius scaled by generation capacity at that node - Per-bus popup shows generator count/capacity, carrier types, load count - Branches: cross-border lines highlighted amber, log-scale width - Hover effects on buses and branches - Collapsible legend with carrier/country color swatches and branch type key - CartoDB Positron basemap for cleaner data visualization - Click-to-filter callback support (onBusClick prop) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
f9c0f8f to
f4d014e
Compare
for more information, see https://pre-commit.ci
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Implements the project roadmap items: dashboard-style analysis, component data browser, interactive map, saved views, network sharing, and run creation form.
Features
network_sharesjoin table, with user search and share management dialogBackend changes
components.py,map.py,views.py,analysis.py(new);networks.py,main.py(modified)components.py,views.py,analysis.py(new);network.py(modified)analysis.py(new);network.py(modified)SavedView,network_sharestable added0003_add_saved_views.py,0004_add_network_shares.pycan_access()extended to check network sharescarrier_colors.py, enhancedserializers.pyFrontend changes
ComponentBrowser.svelteNetworkMap.svelteSaveViewDialog.svelteViewSelector.svelteShareDialog.svelteCreateRunDialog.svelteBug fixes included
n.export()→n.export_to_netcdf()(correct PyPSA API)regex=False)Test plan
🤖 Generated with Claude Code