Repository navigation
Fix the Series name of ModelChain DC ohmic losses - #2912
Merged
Merged
Conversation
Hey @xiajiahang! 🎉Thanks for opening your first pull request! We appreciate your If AI is used for any portion of this PR, you must vet the content Finally, be sure the PR description includes the PR |
echedey-ls
approved these changes
Oct 19, 2026
| ~~~~~~~~~ | ||
| * Correct the Series name in ``ModelChain.results.dc_ohmic_losses`` from | ||
| ``i_mp`` to ``p_dc_ohmic_loss`` when using ``dc_ohms_from_percent``. | ||
| (:issue:`1959`) |
Member
There was a problem hiding this comment.
Suggested change
| (:issue:`1959`) | |
| (:issue:`1959`, :pull:`2912`) |
cwhanse
reviewed
Oct 19, 2026
Member
|
thanks @xiajiahang |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ModelChain.results.dc_ohmic_lossesinherits the namei_mpfrom itsinput current Series, although the result contains power losses. Name the
Series
p_dc_ohmic_lossfor both single-array and tuple results, documentthe name, and extend the existing ModelChain regression tests.
Validation:
Regression tests before the fix: 3 failures on the incorrect Series name.
python -m pytest tests/test_modelchain.py -q: 160 passed.python -m pytest -q: 1449 passed, 177 skipped, 2 xfailed; 22 warnings.python -m flake8 pvlib/modelchain.py tests/test_modelchain.py: passed.git diff --check: passed.Closes Name field of modelchain.results.dc_ohmic_losses is i_mp, which is not correct #1959
I am familiar with the contributing guidelines
I attest that all AI-generated material has been vetted for accuracy and is in compliance with the pvlib license
Tests added
Updates entries in
docs/sphinx/source/referencefor API changes. (Not applicable: no new API; existing result attribute documentation updated.)Adds description and name entries in the appropriate "what's new" file in
docs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
Pull request is nearly complete and ready for detailed review.
Maintainer: Appropriate GitHub Labels (including
remote-data) and Milestone are assigned to the Pull Request and linked Issue.