Skip to content

Fix inconsistencies #1268

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 38 commits into from
Aug 9, 2021
Merged

Conversation

AdamRJensen
Copy link
Member

@AdamRJensen AdamRJensen commented Jul 30, 2021

Enforce the usage of the following terminology in pvlib iotools inputs: start/end, latitude/longitude, and metadata. Also, location information (such as latitude/longitude or station name) should come before start/end.

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 for this cleanup @AdamRJensen! Comments below, and two more here:

  • We'll have to update the existing PVGIS tests at some point before 0.10, might as well specify map_variables=False now so that it's not emitting warnings in the mean time.
  • introtutorial.rst uses pvlib.iotools.get_pvgis_tmy, might as well use map_variables=True there too since it does the same thing manually anyway.

@AdamRJensen
Copy link
Member Author

Thanks for the review @kanderso-nrel. Consider all changes implemented.

I've added variable_map=False to all pvgis_tmy tests and they are silent now.

I'm beginning to see something beautiful about the code review process - it truly does make for much better and consistent code.

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.

LGTM, would be good to get someone else's (@wholmgren?) feedback too because breaking changes are always scary.

@kandersolar kandersolar mentioned this pull request Aug 9, 2021
24 tasks
@kandersolar kandersolar added this to the 0.9.0 milestone Aug 9, 2021
@kandersolar kandersolar added the api label Aug 9, 2021
Copy link
Member

@wholmgren wholmgren 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. Check out the code below for an example of using fail_on_pvlib_version

@fail_on_pvlib_version('1.0')
def test_ModelChain_attributes_deprecated_10(sapm_dc_snl_ac_system, location):
match = 'Use ModelChain.results'
mc = ModelChain(sapm_dc_snl_ac_system, location)
with pytest.warns(pvlibDeprecationWarning, match=match):
mc.aoi
with pytest.warns(pvlibDeprecationWarning, match=match):
mc.aoi = 5

While you're at it, can you change that decorator argument to '0.10'?

return data

if map_variables is None:
warnings.warn(
Copy link
Member

Choose a reason for hiding this comment

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

We need to test that this warning is emitted and mark that test with the fail_on_pvlib_version decorator. This ensures that we don't forget to remove deprecated functionality.

Copy link
Member Author

@AdamRJensen AdamRJensen Aug 9, 2021

Choose a reason for hiding this comment

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

@wholmgren Very smart, thanks for showing me this!

I believe all of your comments have been addressed.

Copy link
Member

@wholmgren wholmgren left a comment

Choose a reason for hiding this comment

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

@kanderso-nrel ready to merge?

@kandersolar kandersolar merged commit f318c1c into pvlib:master Aug 9, 2021
@AdamRJensen AdamRJensen deleted the pvlib_inconsistencies branch August 10, 2021 08:35
@AdamRJensen AdamRJensen mentioned this pull request Jan 8, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add map_variables argument to get_pvgis_tmy Inconsistencies in iotools
3 participants