Skip to content

Feat/extremes/348 temp extremes endpoint pour tableau#437

Open
artdrou wants to merge 8 commits intomainfrom
feat/extremes/348-temp-extremes-endpoint-pour-tableau
Open

Feat/extremes/348 temp extremes endpoint pour tableau#437
artdrou wants to merge 8 commits intomainfrom
feat/extremes/348-temp-extremes-endpoint-pour-tableau

Conversation

@artdrou
Copy link
Copy Markdown
Collaborator

@artdrou artdrou commented Apr 29, 2026

Type de PR

  • Bugfix
  • Feature
  • Refactor
  • Chore / Tech debt
  • Documentation
  • Autre (à préciser)

Objectif

Ajout de l'endpoint GET /api/v1/temperature/extremes : tableau paginé des stations avec leur Tmin ou Tmax moyenne sur une période donnée.

Contexte

Story #348. Endpoint simelaireà temperature/deviation : même structure (pagination, tri, filtres), mais sur les températures extrêmes (min ou max) au lieu des écarts à la normale.

Les filtres classe_recente, date_de_creation, date_de_fermeture ont été ajoutés en suivant le pattern introduit par la PR #384 .

Changements

Nouveau endpoint GET /api/v1/temperature/extremes avec pagination, tri et filtres
Types : MinMaxOverviewQuery, MinMaxOverviewStation, MinMaxOverviewResult
Protocol MinMaxOverviewDataSource + service compute_minmax_overview
Filtres : station_ids, station_search, textreme_min/max, tmean_min/max, alt_min/max, classe_recente_min/max, date_de_creation_min/max, date_de_fermeture_min/max, departments, regions
Fake data source pour les tests (3 stations statiques)
Spec OpenAPI complète

Décisions techniques

Impacts

  • API / contrat
  • Modèle de données / DB
  • Calculs métier
  • Performance
  • Sécurité
  • Infra / déploiement
  • Aucun impact transverse identifié

Tests

  • Tests unitaires
  • Tests d’intégration
  • Tests manuels
  • Non applicable (à justifier)

Points d’attention pour la review

Suivi

  • Migration à prévoir
  • Documentation à mettre à jour
  • Tâche(s) de suivi à créer

Comment thread backend/openapi/target-specs/openapi.yaml
Comment on lines +564 to +569
- tmax
- tmin
default: tmax
description: >
Type d'extrême à calculer : `tmax` pour la température maximale,
`tmin` pour la température minimale.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On utilise pas tn et tx ? @AntoineFede

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

la ca reste cohérent avec le premier endpoint min max, tn et tx sont les noms des colonnes en BDD, je peux changer si besoin?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En météo j'ai l'impression que c’est courant de dire tn et tx, donc à voir avec @AntoineFede s'il veut rester dans les noms du milieu, d'autant plus qu'on parle d'une API, ou s'il veut garder une approche plus agnostique

Comment thread backend/openapi/target-specs/openapi.yaml
Comment on lines +731 to +747
- name: limit
in: query
required: false
schema:
type: integer
minimum: 1
default: 50
description: Nombre maximal d'éléments retournés.

- name: offset
in: query
required: false
schema:
type: integer
minimum: 0
default: 0
description: Nombre d'éléments à ignorer avant de commencer la page.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je suis perdu entre limit/offset et page/page_size @AntoineFede @Jolymark @rnoyer

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai uniformisé avec deviation mais peut etre que c'est plus intuitif page et page_size

Comment thread backend/weather/data_sources/timescale.py
Comment thread backend/weather/data_sources/timescale.py
Comment thread backend/weather/data_sources/timescale.py
Comment thread backend/weather/serializers.py
Comment thread backend/weather/services/temperature_minmax/types.py
@jlecordier
Copy link
Copy Markdown
Collaborator

Un coup on utilise Extremes, un coup on utilise MinMax, faudrait uniformiser @AntoineFede

@AntoineFede
Copy link
Copy Markdown
Collaborator

Un coup on utilise Extremes, un coup on utilise MinMax, faudrait uniformiser @AntoineFede

Utilisons extremes comme initialement fait par Marc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants