Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Estimation Pydantic #2

Merged

Conversation

jpn--
Copy link
Collaborator

@jpn-- jpn-- commented Oct 13, 2024

This pull request introduces significant improvements to the activitysim/core/estimation.py file, focusing on the configuration and validation of estimation settings using Pydantic models. The most important changes include the addition of new Pydantic classes for configuration, refactoring of the Estimator class to use these new configurations, and the replacement of dictionary-based settings access with attribute-based access.

Configuration and Validation Improvements:

  • Introduced new Pydantic models: SurveyTableConfig, EstimationTableRecipeConfig, and EstimationConfig to handle configuration settings with validation. (activitysim/core/estimation.py)
  • Added a Pydantic class validator to ensure the integrity of model_estimation_table_types against estimation_table_recipes. (activitysim/core/estimation.py)

Refactoring:

  • Refactored the Estimator class to use the new Pydantic models for configuration settings, replacing dictionary-based settings. (activitysim/core/estimation.py) [1] [2]
  • Updated various methods to access settings attributes directly from the Pydantic models instead of using dictionary get methods. (activitysim/core/estimation.py) [1] [2] [3] [4] [5] [6] [7] [8]

Initialization:

  • Modified the initialize_settings method in EstimationManager to read settings using the new EstimationConfig Pydantic model. (activitysim/core/estimation.py) [1] [2]

These changes enhance the robustness and maintainability of the estimation configuration handling in the codebase. checking of estimation mode settings.

@dhensle dhensle merged commit 6a50abb into RSGInc:estimation_enhancements Nov 7, 2024
18 checks passed
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.

2 participants