-
Notifications
You must be signed in to change notification settings - Fork 0
Improve test stability #4
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
base: estimation_enhancements
Are you sure you want to change the base?
Improve test stability #4
Conversation
* limit multimethod version to 2.0 and earlier * add multimethod version to other settings * [makedocs] update installer download link * [makedocs] update branch docs
* use libmamba solver * add permissions [makedocs] * add write permission for dev docs [makedocs] * conda-solver: classic
…vitySim#901) Co-authored-by: Jeffrey Newman <[email protected]>
* use libmamba solver * add permissions [makedocs] * add write permission for dev docs [makedocs] * conda-solver: classic * include workflow dispatch option for tests * update release instructions * add installer build to instructions * Pin mamba for now, per conda-incubator/setup-miniconda#392 * conda-remove-defaults
…on_enhancements # Conflicts: # conda-environments/activitysim-dev-base.yml # conda-environments/activitysim-dev.yml # conda-environments/docbuild.yml # conda-environments/github-actions-tests.yml # pyproject.toml
* fix link * allow failure to import larch * workflow * blacken * try some pins * speed up docbuild * use pandas 2 for docs * oops wrong file * restore foundation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves test stability for the estimation module by updating model parameter constraints, modifying test cases, and adjusting version checks. Key changes include adjusting parameter locking in the trip destination model tests, updating larch version handling to correctly process development versions, and updating documentation and CI configuration files.
Reviewed Changes
Copilot reviewed 17 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
docs/users-guide/estimation-mode/general.md | Added documentation for using Larch and fixed a typo in the parameter name for optimization. |
conda-environments/* | Updated dependencies by adding a multimethod version constraint. |
activitysim/estimation/test/test_larch_estimation.py | Adjusted test cases to use the SLSQP algorithm and applied a parameter lock for the trip destination model. |
activitysim/estimation/larch/location_choice.py | Improved handling of alternative availability by adding an optional availability expression parameter. |
activitysim/estimation/larch/init.py | Modified version check logic to account for development versions of larch. |
activitysim/core/workflow/tracing.py | Revised table selection for tracing by preferring proto tables when available. |
activitysim/abm/models/disaggregate_accessibility.py | Changed deregistration of traceable tables to drop all proto-related tables. |
HOW_TO_RELEASE.md | Updated release instructions including tagging and environment handling commands. |
.github/workflows/* | Updated GitHub Actions configuration with new setup options and tooling versions. |
Files not reviewed (6)
- activitysim/estimation/test/test_larch_estimation/test_loc_trip_destination_BHHH_loglike.csv: Language not supported
- activitysim/estimation/test/test_larch_estimation/test_loc_trip_destination_SLSQP_loglike.csv: Language not supported
- activitysim/estimation/test/test_larch_estimation/test_loc_trip_destination_SLSQP_size_spec.csv: Language not supported
- activitysim/estimation/test/test_larch_estimation/test_location_model_trip_destination_BHHH_None_.csv: Language not supported
- activitysim/estimation/test/test_larch_estimation/test_location_model_trip_destination_SLSQP_None_.csv: Language not supported
- docs/gettingstarted.rst: Language not supported
Comments suppressed due to low confidence (1)
docs/users-guide/estimation-mode/general.md:31
- Typo found: 'mathod' should be corrected to 'method' to accurately reflect the intended argument name.
The `larch.Model.estimate` method allows the user to specify the optimization algorithm to use via the `mathod` argument, which can be set to 'BHHH', 'SLSQP', or any other algorithm ...
```sh | ||
bump2version patch --new-version 1.2.3 --list | ||
git -a v1.2.3 -m "Release v1.2.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git command for tagging a release appears to be incorrect. It should likely use 'git tag -a v1.2.3 -m "Release v1.2.3"' instead of 'git -a v1.2.3 -m "Release v1.2.3"'.
git -a v1.2.3 -m "Release v1.2.3" | |
git tag -a v1.2.3 -m "Release v1.2.3" |
Copilot uses AI. Check for mistakes.
…on_enhancements # Conflicts: # activitysim/estimation/larch/__init__.py # activitysim/estimation/larch/cdap.py # activitysim/estimation/larch/general.py # activitysim/estimation/larch/location_choice.py # activitysim/estimation/larch/mode_choice.py # activitysim/estimation/larch/nonmand_tour_freq.py # activitysim/estimation/larch/scheduling.py # activitysim/estimation/larch/simple_simulate.py # activitysim/estimation/larch/stop_frequency.py
This reverts commit be5d093.
This pull request includes several changes to the
activitysim/estimation
module, primarily focusing on updating thelarch
version handling, modifying test cases, and adjusting model parameters.The key change is applying a constraint on the trip model choice model, to solve an over specification problem and ensure the estimation results are stable.
The most important changes are grouped by their themes below.
Test Case Adjustments:
test_location_model
function to lock a parameter and set a cap for the "trip_destination" model to ensure model identifiability.test_simple_simulate
function inactivitysim/estimation/test/test_larch_estimation.py
to also use the "SLSQP" method for the "trip_destination" model. The SLSQP algorithm obeys constraints on parameter values, while the BHHH algorithm does not, yielding very different answers. Which is "better" depends on the modeler's opinion on the validity of the constraints.Version Handling:
larch
version check inactivitysim/estimation/larch/__init__.py
to handle development versions correctly.Model Parameter Updates:
test_loc_trip_destination_BHHH_loglike.csv
andtest_loc_trip_destination_SLSQP_loglike.csv
to reflect new model results. [1] [2]test_loc_trip_destination_SLSQP_size_spec.csv
.CSV File Updates:
test_location_model_trip_destination_BHHH_None_.csv
to reflect new model results.test_location_model_trip_destination_SLSQP_None_.csv
with updated parameter values for the "trip_destination" model.