How dhwanibro/imp works
KrishiSetu turns district and crop history into seasonal crop advice: data is prepared into weather and scoring contexts, weather models generate monthly forecasts, crop scorers evaluate crop-by-sowing-window options, and aggregation summarizes results across forecast futures. The web app presents policy tiers and levers or goal-ranked grower advice; the CLI exposes a parallel analysis workflow. The README documents these capabilities, but sampled server code is partial, so dashboard wiring is shown only where documented. Some subsystems, including pilot-data handling, are represented at the directory level because their implementation was not excerpted.
Main entry points: pipeline.py Prepare contexts · app.py Dashboard API · scorer.py Crop options · weather Weather models
Components 21
Data and configuration
- District dataset
krishi/data.py - Seasons and settings
krishi/config.py - Crop conditions
krishi/crops.py - MSP mapping
krishi/msp.py - Prepare contexts
krishi/pipeline.py - Pilot data support
krishi/pilot.py
Weather forecasting
- Model registry
krishi/registry.py - Weather context
krishi/weather/forecaster.py - Weather models
krishi/weather - Monthly futures
krishi/weather/forecaster.py
Crop scoring
- Scoring context
krishi/scoring/scorer.py - Rule-based scorer
krishi/scoring/rule_based.py - Yield model scorer
krishi/scoring/ml_yield.py - Economic scorer
krishi/scoring/economic.py - Crop options
krishi/scoring/scorer.py - Feasibility aggregation
krishi/scoring/aggregate.py
Advice and interfaces
- Dashboard API
server/app.py - Grower dashboard
server/static/grow.html - Policy dashboard
server/static/policy.html - Command-line analysis
krishi/cli.py
Other components
- Grower or policymaker
Connections 26
- Prepare contexts → District dataset: loads dataset
krishi/pipeline.py - Prepare contexts → Seasons and settings: uses settings
krishi/pipeline.py - Prepare contexts → Crop conditions: generates conditions
krishi/pipeline.py - Prepare contexts → MSP mapping: loads prices
krishi/pipeline.py - Prepare contexts → Weather context: builds context
krishi/pipeline.py - Prepare contexts → Scoring context: builds context
krishi/pipeline.py - Weather models → Model registry: registers models
krishi/weather/__init__.py - Weather models → Weather context: fits from context
krishi/weather/ar_trend.py - Weather models → Monthly futures: predicts futures
krishi/weather/forecaster.py - Rule-based scorer → Scoring context: fits from context
krishi/scoring/rule_based.py - Yield model scorer → Scoring context: fits from context
krishi/scoring/ml_yield.py - Yield model scorer → Rule-based scorer: uses validation
krishi/scoring/ml_yield.py - Economic scorer → MSP mapping: uses price data
krishi/scoring/economic.py - Rule-based scorer → Crop options: evaluates forecasts
krishi/scoring/scorer.py - Yield model scorer → Crop options: evaluates forecasts
krishi/scoring/scorer.py - Economic scorer → Crop options: scores options
krishi/scoring/economic.py - Monthly futures → Crop options: scores each future
- Feasibility aggregation → Crop options: summarizes futures
krishi/scoring/scorer.py - Dashboard API → Prepare contexts: prepares data
server/app.py - Dashboard API → Feasibility aggregation: aggregates runs
server/app.py - Dashboard API → Grower dashboard: serves page
- Dashboard API → Policy dashboard: serves page
- Grower or policymaker → Dashboard API: requests advice
README.md - Command-line analysis → Prepare contexts: prepares contexts
krishi/cli.py - Command-line analysis → Feasibility aggregation: aggregates forecasts
krishi/cli.py - Grower or policymaker → Command-line analysis: runs analysis
README.md