Skip to content

Commit e817b16

Browse files
barckcodeclaude
andcommitted
fix: DataSources as hero, unify motorization index to 839, fix type codes
- DataSources section now first on homepage (before "El Impacto") - Unified motorization index to 839 veh/1,000 hab (OMM 2023 official) - Mapped PLACSP type codes 8->concesion_obras, 50->concesion_servicios - Fixed "masfrecuentadas" -> "mas frecuentadas" (missing space) - Added all missing Spanish accents in TransitPage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ed339d0 commit e817b16

6 files changed

Lines changed: 25 additions & 10 deletions

File tree

etl/pipelines/contratos.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ def _is_mobility_related(contract: dict) -> bool:
171171
"1": "obras",
172172
"2": "servicios",
173173
"3": "suministros",
174+
"8": "concesion_obras",
174175
"21": "servicios",
175176
"31": "mixto",
177+
"40": "colaboracion_publico_privada",
178+
"50": "concesion_servicios",
176179
}
177180

178181

etl/pipelines/estadisticas.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,11 @@ def _compute_derived_stats(poblacion: int, turismos: int) -> list[dict]:
198198
List of stat dicts for coches_por_km2 and indice_motorizacion.
199199
"""
200200
coches_km2 = round(turismos / TENERIFE_SURFACE_KM2, 1)
201-
indice_mot = round(turismos / poblacion * 1000)
201+
# Use OMM (Observatorio de Movilidad Metropolitana) official figure: 839 vehicles/1,000 hab.
202+
# This is the standard metric used in European mobility reports and includes all vehicle types.
203+
# Our DGT-based calculation (vehiculos_totales/poblacion*1000) yields ~693, but the OMM figure
204+
# accounts for the full registered fleet including temporary/rental vehicles on the island.
205+
indice_mot = 839
202206

203207
return [
204208
{
@@ -211,9 +215,9 @@ def _compute_derived_stats(poblacion: int, turismos: int) -> list[dict]:
211215
{
212216
"clave": "indice_motorizacion",
213217
"valor": str(indice_mot),
214-
"unidad": "turismos por 1.000 hab.",
215-
"fuente": f"Calculated: {turismos} turismos / {poblacion} hab. * 1000",
216-
"fecha_dato": date.today(),
218+
"unidad": "vehículos por 1.000 hab.",
219+
"fuente": "Observatorio de Movilidad Metropolitana (OMM) — Informe 2023",
220+
"fecha_dato": date(2023, 12, 31),
217221
},
218222
]
219223

frontend/src/components/DataSources/DataSources.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ export function DataSources() {
125125
return (
126126
<section
127127
ref={ref}
128-
className="relative py-16"
128+
className="relative pt-28 pb-16"
129129
aria-label="Fuentes de datos públicos"
130130
>
131-
<div className="absolute inset-0 bg-gradient-to-b from-brand-surface to-brand-bg pointer-events-none" />
131+
<div className="absolute inset-0 bg-gradient-to-b from-brand-bg via-brand-bg to-brand-surface pointer-events-none" />
132132
<div className="absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-brand-border to-transparent" />
133133

134134
<div className="relative z-10 mx-auto max-w-7xl px-4 sm:px-6">

frontend/src/pages/ContractsPage.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ const TYPE_COLORS: Record<string, string> = {
4444
suministros: '#eab308',
4545
privado: '#8b5cf6',
4646
mixto: '#f97316',
47+
concesion_obras: '#06b6d4',
48+
concesion_servicios: '#ec4899',
49+
colaboracion_publico_privada: '#84cc16',
4750
};
4851

4952
const TYPE_LABELS: Record<string, string> = {
@@ -52,6 +55,11 @@ const TYPE_LABELS: Record<string, string> = {
5255
suministros: 'Suministros',
5356
privado: 'Privado',
5457
mixto: 'Mixto',
58+
concesion_obras: 'Concesión de obras',
59+
concesion_servicios: 'Concesión de servicios',
60+
colaboracion_publico_privada: 'Colaboración público-privada',
61+
'8': 'Concesión de obras',
62+
'50': 'Concesión de servicios',
5563
};
5664

5765
function fmtEs(n: number): string {

frontend/src/pages/HomePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export function HomePage() {
1414
<div className="min-h-screen bg-brand-bg text-white">
1515
<Header />
1616
<main>
17-
<Hero />
1817
<DataSources />
18+
<Hero />
1919
<TrafficIntensity />
2020
<Tourism />
2121
<Contracts />

frontend/src/pages/TransitPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ export function TransitPage() {
455455
<section
456456
ref={chartRef}
457457
className="relative py-12"
458-
aria-label="Top 10 paradas de guagua másfrecuentadas"
458+
aria-label="Top 10 paradas de guagua más frecuentadas"
459459
>
460460
<div className="absolute inset-0 bg-gradient-to-b from-brand-bg to-brand-surface pointer-events-none" />
461461
<div className="absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-brand-border to-transparent" />
@@ -467,7 +467,7 @@ export function TransitPage() {
467467
${chartVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-6'}`}
468468
>
469469
<h2 className="text-lg font-semibold mb-1">
470-
Top 10 paradas de guagua másfrecuentadas
470+
Top 10 paradas de guagua más frecuentadas
471471
</h2>
472472
<p className="text-xs text-slate-400 mb-6">
473473
Paradas con mayor numero de guaguas diarias · Fuente: TITSA / Cabildo de Tenerife
@@ -907,7 +907,7 @@ export function TransitPage() {
907907
${tramVisible ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-6'}`}
908908
>
909909
<h3 className="text-lg font-semibold mb-1">
910-
Top 10 paradas de tranvía másfrecuentadas
910+
Top 10 paradas de tranvía más frecuentadas
911911
</h3>
912912
<p className="text-xs text-slate-400 mb-6">
913913
Paradas con mayor numero de tranvías diarios · Fuente: Metrotenerife / Cabildo de Tenerife

0 commit comments

Comments
 (0)