Skip to content

[US] Établir un rapport de tous les paramètres d'entrée #198#240

Merged
FlxPo merged 10 commits intomainfrom
rapport
Feb 27, 2026
Merged

[US] Établir un rapport de tous les paramètres d'entrée #198#240
FlxPo merged 10 commits intomainfrom
rapport

Conversation

@mariegrandclement
Copy link
Contributor

PR liée à l'US #198

Ajout d'une fonction parameters_dict dans la classe PopulationTrips pour récupérer les paramètres suivants :

  • inner_radius
  • local_admin_unit_id
  • population_sample_size
  • survey_used
  • number of local_admin_units in model
  • inputs_hash
    Modification de la fonction plot_od_flows de la classe PopulationTrips pour afficher la liste des paramètres et le hash sur la carte.

Reste à faire :

  • Identifier et les lister les paramètres pertinents à afficher pour l'utilisateur
  • Améliorer la fonction parameters_dict (peut-être avec une catégorisation des paramètres ?)
  • Améliorer l'affichage sur les cartes

Copy link
Contributor

@Mind-the-Cap Mind-the-Cap left a comment

Choose a reason for hiding this comment

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

Very good first draft, let's include all parameters!

labels = pop_trips.get_prominent_cities()
pop_trips.plot_od_flows(labels=labels)

rapport = pop_trips.parameters_dict()
Copy link
Contributor

Choose a reason for hiding this comment

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

Good idea to put it here! Can we stick to English (report) ? Let's add a comment to help future users understand what it does

@FlxPo
Copy link
Contributor

FlxPo commented Jan 23, 2026

Suite à notre discussion, je propose les modifications suivantes :

  • Création d'une classe générique Parameter avec les propriétés suivantes :

    • Nom (obligatoire)
    • Valeur (obligatoire)
    • Définition
    • Valeurs possibles (intervalle, valeurs uniques…)
    • Valeur par défaut
    • Source des valeurs par défaut
    • Type de paramètre (hypothèse comportementale, paramètre de simulation…)
  • Création d'une méthode list_parameters dans la classe Asset, qui renvoie une liste des objets de type Parameter :

    • présents dans le dict inputs de l'instance (V1).
      • ceux présents dans les dicts inputs des objets en amont, de manière récursive (V2).
  • Pour le rapport, peut être générer un fichier markdown assez simple avec une section par paramètre pour le moment ?

@mariegrandclement
Copy link
Contributor Author

New approach using class Parameter and function get_parameters in FileAsset

  • Created class Parameter (using model_parameters.py made by Capucine)
  • Created function get_parameters in class FileAsset, with a recursive attribute, in order to get all unique parameters of the object (if recursive=false) or the parameters of the object and all upper objects (if recursive=true).
  • Modified function compute_inputs_hash from class Asset in order to manage the fact that some inputs are now Parameters objects
  • Modified class StudyArea in order to define radius as a Parameter
  • Modified class TransportZones in order to define level_of_detail as a Parameter
  • Tested transport_zones.get_parameters() in quickstart

FlxPo
FlxPo previously requested changes Feb 20, 2026
@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.50%. Comparing base (13c9b74) to head (a3511ee).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
+ Coverage   70.42%   70.50%   +0.08%     
==========================================
  Files          56       56              
  Lines        2424     2431       +7     
==========================================
+ Hits         1707     1714       +7     
  Misses        717      717              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FlxPo
Copy link
Contributor

FlxPo commented Feb 27, 2026

Changes

  • Introduced/standardized pydantic parameter models across key assets and domain classes.
  • Unified init handling so classes can accept:
    • a parameters pydantic instance, and/or
    • explicit kwargs (merged into parameters with provenance tracking).
  • Moved toward consistent access pattern: self.inputs["parameters"].foo
  • Updated hashing (compute_inputs_hash) to serialize pydantic models via model_dump(mode="json").
  • Added recursive parameter introspection/reporting on Asset:
    • flat rows output (list[dict])
    • pandas DataFrame view
    • markdown report rendering (sectioned, human-readable).
  • Updated PopulationTrips and upstream dependencies to propagate/report parameters through the DAG.
  • Added constraints/metadata (titles/descriptions/units) in parameter models where relevant.
  • Removed older standalone parameter modules that were replaced by colocated pydantic models.

@FlxPo FlxPo merged commit 912120c into main Feb 27, 2026
4 checks passed
FlxPo added a commit that referenced this pull request Feb 27, 2026
…uted iteration (#261)

* fix congestion propagation when using multiple runs

* add checkpoints to population trips runs

* cleanup

* win 1252 to utf8 to avoid doc build issue

* Avoid leakage of flows data between subsequent runs (#260)

* fix congestion propagation when using multiple runs

* win 1252 to utf8 to avoid doc build issue

* Update README.md (#252)

* Align stay-home baseline utility with min_activity_time_constant (#265)

* Use saturation-weighted effective sink in destination sampling (#267)

* Leisures (#262)

* update the parsing of the leasure motive oppotunities

* update the parsing of the leasure motive oppotunities

* fix wrong leisure zones

* update the branch to the main

* fix PR issues on leisures

* Align prepare_transport_zones with main

* Fix types mismatch

* reenable float64 cast

---------

Co-authored-by: lucas_bohnenkamp0 <lucas.bohnenkamp@arep.fr>
Co-authored-by: FlxPo <flx.pouchain@gmail.com>

* replace clara clustering by kmeans + knn clustering (#271)

* add state-transition waterfall diagnostic (#269)

* add checkpoints to population trips runs

* cleanup

* [US] Établir un rapport de tous les paramètres d'entrée #198 (#240)

* Parameter reporting via pydantic

* avoid pydantic deprecation notice

* fix tests

* add parameters report to quickstart

* allow mixing kwargs and pydantic parameters + update PopulationTrips to use the new parameters handling method

* Population with pydantic model in inputs

* update motives to use the new parameters handling method

* update mobility surveys to use the new parameters handling method

* update modes to use the new parameters handling method

* move pydantic models alongside the class they are used in to remove the number of files

---------

Co-authored-by: FlxPo <flx.pouchain@gmail.com>

* add checkpoints to population trips runs

* cleanup

* fix congestion propagation when using multiple runs

* add checkpoints to population trips runs

---------

Co-authored-by: Cap <capucine-marin.dubroca-voisin@arep.fr>
Co-authored-by: lucas-boh <83457283+lucas-boh@users.noreply.github.com>
Co-authored-by: lucas_bohnenkamp0 <lucas.bohnenkamp@arep.fr>
Co-authored-by: mariegrandclement <marie.grand-clement@arep.fr>
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