Skip to content

fix: remove zero-fill in singlediode DC model to preserve NaNs (Close…#2763

Open
Mohamedhassan268 wants to merge 1 commit into
pvlib:mainfrom
Mohamedhassan268:fix-1409-nan-in-dc-model
Open

fix: remove zero-fill in singlediode DC model to preserve NaNs (Close…#2763
Mohamedhassan268 wants to merge 1 commit into
pvlib:mainfrom
Mohamedhassan268:fix-1409-nan-in-dc-model

Conversation

@Mohamedhassan268
Copy link
Copy Markdown

This PR addresses Issue #1409. I removed the .fillna(0) behavior inside ModelChain._singlediode

@github-actions
Copy link
Copy Markdown

Hey @Mohamedhassan268! 🎉

Thanks for opening your first pull request! We appreciate your
contribution. Please ensure you have reviewed and understood the
contributing guidelines.

If AI is used for any portion of this PR, you must vet the content
for technical accuracy.

Copy link
Copy Markdown
Member

@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

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

@Mohamedhassan268 I doubt there is an existing test in test_modelchain.py that includes nan in the weather input. I am concerned that removing the fillna(0) will uncover other problems.

Can you make a new test for test_modelchain.py that checks for proper handling of nan in weather input? Just so we can see what may go wrong?

In the end I think we'll want to add nan to the weather fixture. However, that's not a simple task because test_modelchain.py has a lot of tests that use the weather fixture, and I suspect that some tests rely on the index length of 2 to match weather with other data.

Comment thread pvlib/modelchain.py
Comment on lines -669 to -670
# If the system has one Array, unwrap the single return value
# to preserve the original behavior of ModelChain
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please undo this delete - the comment is about the following if statement.

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