You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor to installable package, add realistic data generator, tests and CI
Software engineering
- Move logic to a `src/inventory` package (config, data_gen, kpis) with a
clean public API. Notebook and Streamlit app now import the same code,
so cálculos quedan garantizados consistentes
- Add pyproject.toml (setuptools build, ruff + pytest config, optional
extras `[dev]` and `[app]`)
- Add `tests/` with 17 pytest cases covering generator invariants, KPI
monotonicity wrt service level / lead time, traffic-light boundaries,
determinism and zero-variance edge cases
- Add GitHub Actions CI: ruff + pytest on Python 3.10/3.11/3.12
Data realism
- Replace the trivial Poisson + independent-normal-stock generator with
one that produces an ABC curve (Pareto-distributed baselines), weekly +
annual seasonality, per-SKU trend, promotional spikes, log-normal lead
times and coherent stock evolution under an (s, Q) replenishment policy
- Result: stockouts emerge from the simulation (2.7k stockout-days in the
default dataset), so KPIs and the traffic light expose meaningful risk
Notebook / dashboard wiring
- Notebook bootstraps `src/` onto sys.path and consumes the package
- Streamlit app imports KPI and config helpers from the package instead of
re-implementing them
- Regenerate inventory_transactions.csv and inventario_kpis.xlsx with the
new generator (54,750 rows: 50 products × 3 warehouses × 365 days)
README
- New sections: package API, realistic generator details, tests + CI
- Add CI / Python / ruff badges
- Update structure, stack and reproduce-the-analysis instructions
[](https://colab.research.google.com/github/NJerez-dev/Logistics-data-portfolio/blob/main/inventory_analysis.ipynb)
-[Generador de datos realista](#generador-de-datos-realista)
17
21
-[Stack técnico](#stack-técnico)
18
22
-[Estructura del repositorio](#estructura-del-repositorio)
19
23
-[Cómo reproducir el análisis](#cómo-reproducir-el-análisis)
20
24
-[Análisis realizado](#análisis-realizado)
21
25
-[KPIs calculados](#kpis-calculados)
26
+
-[Tests y CI](#tests-y-ci)
22
27
-[Conclusiones clave](#conclusiones-clave)
23
28
-[Próximos pasos](#próximos-pasos)
24
29
-[Licencia](#licencia)
@@ -27,12 +32,13 @@ bodega y categoría.
27
32
28
33
Mostrar un flujo end-to-end de análisis de datos logísticos:
29
34
30
-
1.**Generación** de un dataset sintético realista (50 productos × 3 bodegas × 180 días).
35
+
1.**Generación** de un dataset sintético realista (50 productos × 3 bodegas × 365 días, con estacionalidad anual y semanal, curva ABC, lead times log-normales y stock evolucionado de forma coherente).
31
36
2.**Exploración** de ventas por categoría, bodega y producto.
32
37
3.**Detección** de productos en riesgo de quiebre de stock.
33
-
4.**Cálculo** de KPIs de reposición (ROP, Stock de Seguridad) con un nivel de servicio del 95%.
38
+
4.**Cálculo** de KPIs de reposición (ROP, Stock de Seguridad) con un nivel de servicio del 95%.
34
39
5.**Visualización** tipo "semáforo" del estado del inventario.
35
-
6.**Reporting** en un libro Excel multi-hoja con gráficos embebidos.
40
+
6.**Reporting** en un libro Excel multi-hoja y en un **dashboard interactivo de Streamlit**.
41
+
7.**Calidad de código**: paquete instalable con `pyproject.toml`, suite de `pytest` y CI con GitHub Actions.
36
42
37
43
## Dashboard interactivo
38
44
@@ -70,6 +76,59 @@ Abre tu navegador en [http://localhost:8501](http://localhost:8501).
70
76
|**🚦 Estado de inventario**| Semáforo por producto (rojo/amarillo/verde) + ROP overlay. |
71
77
|**📋 KPIs por producto/bodega**| Tabla detallada filtrable + descarga en CSV. |
72
78
79
+
## El paquete `inventory`
80
+
81
+
La lógica de negocio vive en `src/inventory/` como paquete Python instalable
0 commit comments