Skip to content

Fix reverse mapping issue and undesirable column reordering in get_psm3 #1648

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

Merged
merged 8 commits into from
Feb 2, 2023

Conversation

AdamRJensen
Copy link
Member

@AdamRJensen AdamRJensen commented Jan 25, 2023

This PR adds a separate dictionary for variable mapping of the requested parameters (attributes).

I simply removed the set operation (as discussed in #1647), which had the purpose of dropping duplicate values in the list of requested parameters (attributes). If we want to retain that functionality, we can do:

attributes= list(dict.fromkeys(attributes))

@AdamRJensen AdamRJensen marked this pull request as draft January 25, 2023 16:40
@AdamRJensen AdamRJensen added the remote-data triggers --remote-data pytests label Jan 25, 2023
@kandersolar
Copy link
Member

This approach looks good to me. It would be good for the tests to include check that column ordering is not scrambled. Would it make sense to modify test_psm3.py::test_get_psm3_attribute_mapping to assert not just column presence but also ordering?

@AdamRJensen
Copy link
Member Author

AdamRJensen commented Jan 26, 2023

This approach looks good to me. It would be good for the tests to include check that column ordering is not scrambled. Would it make sense to modify test_psm3.py::test_get_psm3_attribute_mapping to assert not just column presence but also ordering?

Yes that should be an easy and simple approach.

Edit: it has now been implemented.

@AdamRJensen AdamRJensen marked this pull request as ready for review January 27, 2023 13:49
Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

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

Both bugfixes warrant mention in the whatsnew IMHO

@kandersolar kandersolar added this to the 0.9.5 milestone Jan 30, 2023
@AdamRJensen AdamRJensen added remote-data triggers --remote-data pytests and removed remote-data triggers --remote-data pytests labels Feb 1, 2023
Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

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

Thanks @AdamRJensen!

@kandersolar kandersolar merged commit 55e0577 into pvlib:main Feb 2, 2023
@AdamRJensen AdamRJensen deleted the remove_set_in_get_psm3 branch February 2, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug io remote-data triggers --remote-data pytests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_psm3() reorders the dataframe columns randomly pvlib.iotools.get_psm3 attribute "reverse mapping" produces invalid names
3 participants