Skip to content

PyDebFlow v0.2.0.2 - Initial Release

Latest

Choose a tag to compare

@ankitdutta428ankitdutta428 released this 14 Apr 19:58

PyDebFlow v0.2.0 — Feature Release

This PR introduces all changes required for the v0.2.0 release of PyDebFlow.


👑 Crown Zone (renamed from "Release Zone")

  • Renamed the "Release Zone" tab → Crown throughout the entire codebase and GUI
  • Added Point and Polygon mode buttons so users can mark, draw, and delete crown zones interactively
  • Added a 🗑️ Remove button to delete the current marker in one click
  • Coordinate entry now uses Latitude / Longitude for geographic (lat/lon) DEMs and Row / Column for projected DEMs — auto-detected from the loaded GeoTIFF
  • Added scroll-wheel zoom on the Crown terrain canvas

📏 Cross-Section Profile (0.1 m Resolution)

  • Profile transect x-axis now sampled at 0.1 m intervals (capped at 5 000 pts for performance)
  • Plot title shows actual transect length and sample count
  • Matplotlib NavigationToolbar (Zoom / Pan / Home) added below the profile plot
  • 💾 Save Plot button exports as PNG / PDF / SVG

📈 Hydrograph (Multi-Point)

  • Added 📍 Set Point, ➕ Add to Graph, and 🗑️ Clear All buttons
  • Up to 8 concurrent monitor points plotted on the same graph with distinct colour-coded series
  • Each point shows flow height (top panel) and velocity + discharge (bottom panel)
  • Monitor points labelled on the terrain map for easy identification
  • Matplotlib NavigationToolbar + 💾 Save Plot button

📊 Statistics Tab (New)

A new Statistics tab is automatically populated after each simulation:

Section Metrics
Descriptive Mean, Std Dev, Min/Max, P5–P95, Skewness, Kurtosis
Spatial Flow area (m²/km²), Perimeter, Centroid (row/col or lat/lon), Bounding box extent
Temporal Simulation duration, Peak height & time, Rise time (0→90%), Recession time (→50%)
Phase Mean solid/fluid fraction, Peak discharge (m³/s)
Statistical Tests Shapiro-Wilk normality test, KS test vs uniform distribution
  • 🔄 Compute Statistics button to recompute on demand
  • 💾 Save CSV and 💾 Save TXT export buttons

🔍 Zoom / Pan / Save (All Widgets)

  • Scroll-wheel zoom on terrain maps in Crown, Profile, and Hydrograph widgets
  • Matplotlib toolbar (Zoom, Pan, Home, Back, Forward) on Profile and Hydrograph canvases
  • Save plot in PNG / PDF / SVG from any analysis widget

🧪 Tests (tests/test_v020.py)

26 new tests covering:

  • Lat/Lon ↔ Row/Col round-trip accuracy
  • Profile x-axis 0.1 m resolution and cap logic
  • Multi-point hydrograph add/clear/series count
  • Statistics computation structure, keys, and value correctness
  • Save-to-file (PNG, PDF, CSV)

📖 Documentation

  • README.md — Added "What's New in v0.2.0" feature table
  • Updated GUI Features list, Architecture file tree, and CLI reference (--release-polygon)
  • src/init.py — Bumped __version__ to "0.2.0"

Files Changed

File Change
src/gui/release_zone_widget.py Rewritten as CrownWidget; backward-compat alias ReleaseZoneWidget kept
src/gui/analysis_widgets.py Overhauled: profile resolution, toolbars, save, multi-point hydro, new StatisticsWidget
src/gui/main_window.py Crown tab rename; Statistics tab added; set_data wired to StatisticsWidget
src/core/terrain.py Added is_geographic, cell_size_deg, mean_lat for coordinate conversion
src/init.py Version bumped to 0.2.0
README.md v0.2.0 feature table, updated sections
tests/test_v020.py New — 26 tests for all v0.2.0 features