-
Notifications
You must be signed in to change notification settings - Fork 123
Fix wrong source package in forward models doc #12670
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: main
Are you sure you want to change the base?
Fix wrong source package in forward models doc #12670
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12670 +/- ##
==========================================
- Coverage 90.68% 90.64% -0.04%
==========================================
Files 429 429
Lines 29804 29817 +13
==========================================
Hits 27028 27028
- Misses 2776 2789 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 fixes a bug where forward model steps were incorrectly reporting "ert" as their source package in the documentation. The issue was caused by using a hardcoded default value in the ForwardModelStepDocumentation class. The fix uses stack inspection to automatically determine the correct source package from the calling plugin module.
Changes:
- Added a new test to verify that forward model step documentation correctly reports the source package of its parent plugin
- Introduced
get_source_package()function that uses stack inspection to dynamically determine the source package - Changed
ForwardModelStepDocumentation.source_packagefield to usedefault_factory=get_source_packageinstead of a hardcoded "ert" default
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/ert/unit_tests/docs/test_ert_documentation.py | Adds regression test that verifies forward model documentation reports correct source package |
| src/ert/config/forward_model_step.py | Implements stack inspection to automatically determine source package for documentation |
379d1ae to
03884ff
Compare
Some forward models wrongly stated ert as the source package due to ert being the default source_package value in the ForwardModelStepDocumentation class. With this commit the source package of the ForwardModelStepPlugin will be used as default value if it is not set explicitly.
03884ff to
2255126
Compare
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
Some forward models wrongly stated ert as the source package due to ert being the default source_package value in the
ForwardModelStepDocumentation class.
With this commit the source package of the ForwardModelStepPlugin will be used as default value if it is not set explicitly.
Issue
Resolves #12402
Approach
Checklist
git rebase -i main --exec 'just rapid-tests')When applicable