How anis29017/crop-yieldmlops works
This repository is a district-level crop-yield prediction service designed to stay current as new official yield and climate data arrive. Its main workflow collects source data, validates and prepares it into a model table, trains a versioned model, and serves predictions and operational status. Separate capabilities monitor climate drift, support retraining, and manage checked blue-green releases. The map follows documented flows and source-index references; some internal API and integration wiring was not shown, so uncertain links are omitted or marked unverified.
Main entry points: quality.py Quality gates and quarantine · silver Silver data tables · fetch.py Yield book fetcher · train.py Model training
Components 28
Data collection
- Yield book fetcher
src/dataops/fetch.py - Source recognition
src/dataops/sources.py - Yield book readers
src/dataops - Climate data fetchers
src/fetch_chirps.py - Climate feature update
src/update_climate.py
Data preparation
- Bronze source archive
data/bronze - Layer and integrity rules
src/layers.py - Silver data tables
data/silver - Yield label builder
src/build_yield_labels.py - Master table builder
src/build_master.py - Table contracts
src/contracts.py - Quality gates and quarantine
src/quality.py - Gold data preparation
src/prepare_data.py - Gold model table
data/gold/processed.csv
Model lifecycle
- Data versioning
src/data_version.py - Model training
src/train.py - Prediction model
src/model.py - Climate drift detection
src/drift.py - Retraining workflow
src/retrain.py
Prediction service
- Prediction API
src/app.py - Prediction explanations
src/explain.py
Operations and release
- Blue-green release checks
src/blue_green.py - Traffic router
src/router.py - Operations console
src/admin.py - Audit trail
src/audit.py
Other components
- Official yield publishers
- Climate and soil providers
- Prediction client
Connections 32
- Official yield publishers → Yield book fetcher: provides books
README.md - Yield book fetcher → Source recognition: applies rules
src/dataops/fetch.py - Yield book fetcher → Bronze source archive: archives downloads
README.md - Yield book fetcher → Yield book readers: pulls and reads
README.md - Climate and soil providers → Climate data fetchers: provides seasons
README.md - Climate data fetchers → Bronze source archive: archives inputs
- Climate feature update → Climate data fetchers: runs fetchers
src/update_climate.py - Climate feature update → Silver data tables: updates features
README.md - Layer and integrity rules → Bronze source archive: checks integrity
README.md - Yield book readers → Silver data tables: builds yield rows
README.md - Yield label builder → Silver data tables: writes labels
src/build_yield_labels.py - Yield label builder → Quality gates and quarantine: gates labels
src/build_yield_labels.py - Master table builder → Silver data tables: reads inputs
README.md - Master table builder → Quality gates and quarantine: gates master
src/build_master.py - Gold data preparation → Silver data tables: reads master
src/prepare_data.py - Gold data preparation → Quality gates and quarantine: gates gold
src/prepare_data.py - Quality gates and quarantine → Table contracts: checks contracts
src/quality.py - Quality gates and quarantine → Gold model table: permits output
- Gold data preparation → Gold model table: writes table
src/prepare_data.py - Model training → Gold model table: trains on
README.md - Model training → Prediction model: wraps estimator
src/train.py - Model training → Data versioning: records data version
src/train.py - Climate drift detection → Gold model table: checks climate data
src/drift.py - Retraining workflow → Climate drift detection: checks drift
src/retrain.py - Retraining workflow → Model training: runs training
src/retrain.py - Prediction client → Prediction API: requests prediction
README.md - Prediction API → Prediction model: predicts with
- Prediction API → Prediction explanations: uses explanations
src/app.py - Blue-green release checks → Traffic router: switches traffic
src/router.py - Operations console → Blue-green release checks: checks releases
src/admin.py - Operations console → Audit trail: records actions
src/admin.py - Traffic router → Audit trail: records switches
src/router.py