Skip to content
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

Adopt dni_clear variable name for clearsky DNI #2274

Merged
merged 19 commits into from
Dec 10, 2024

Conversation

RDaxini
Copy link
Contributor

@RDaxini RDaxini commented Oct 21, 2024

  • Related: Standardise variable name for clearsky GHI and DNI, add to glossary #2272
  • I am familiar with the contributing guidelines
  • Tests added modified
  • Updates entries in docs/sphinx/source/reference for API changes.
  • Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for 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.

dni_clear is already in the variables and symbols list
Also related: #1253, #2306

@RDaxini RDaxini changed the title Adopt dni_clear variable name [WIP] Adopt dni_clear variable name Oct 21, 2024
@AdamRJensen
Copy link
Member

In both this PR and in #2273, you should use the decorate added in #2237.

The reason is that simply changing the parameter name would be a breaking change.

@RDaxini
Copy link
Contributor Author

RDaxini commented Oct 23, 2024

In both this PR and in #2273, you should use the decorate added in #2237.

The reason is that simply changing the parameter name would be a breaking change.

ah I asked about this in the linked issue as I thought it might be, thanks @AdamRJensen

@RDaxini RDaxini marked this pull request as ready for review November 26, 2024 17:59
@RDaxini RDaxini changed the title [WIP] Adopt dni_clear variable name Adopt dni_clear variable name Nov 26, 2024
@RDaxini RDaxini changed the title Adopt dni_clear variable name Adopt dni_clear variable name for clearsky DNI Nov 26, 2024
@RDaxini RDaxini added this to the v0.11.2 milestone Nov 26, 2024
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.

These PRs will certainly need a whatsnew entry.

Has anyone audited iotools to see if we can standardize any clearsky DNI names there too?

@RDaxini RDaxini marked this pull request as draft December 3, 2024 21:08
@RDaxini RDaxini marked this pull request as ready for review December 3, 2024 21:15
Copy link
Contributor

@echedey-ls echedey-ls left a comment

Choose a reason for hiding this comment

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

Mostly rST comments. PR looks good 🚀

Shall any .. deprecated or .. versionchanged directives be used? I'm +1 for the latter, I have the mild impression the former is for complete removals.

Docs at: https://pvlib-python--2274.org.readthedocs.build/en/2274/

@RDaxini
Copy link
Contributor Author

RDaxini commented Dec 5, 2024

Has anyone audited iotools to see if we can standardize any clearsky DNI names there too?

Variable maps exist.
psm3.py, solargis.py, sodapro.py, solcast.py, and solaranywhere.py map to *_clear, e.g:

'Clearsky GHI': 'ghi_clear',
'Clearsky DHI': 'dhi_clear',
'Clearsky DNI': 'dni_clear',

ParameterMap('GHI_C', 'ghi_clear'), # this is stated in documentation
ParameterMap('GHIc', 'ghi_clear'), # this is used in practice
ParameterMap('DNI', 'dni'),
ParameterMap('DNI_C', 'dni_clear'),
ParameterMap('DNIc', 'dni_clear'),
ParameterMap('DIF', 'dhi'),
ParameterMap('GTI', 'poa_global'),
ParameterMap('GTI_C', 'poa_global_clear'),
ParameterMap('GTIc', 'poa_global_clear'),

I'm not 100% familiar with how these maps work but I guess instances of other variable names that are part of the map, e.g.:

you can pass any of the parameters listed in the API docs, like
>>> df, meta = pvlib.iotools.solcast.get_solcast_live(
>>> latitude=-33.856784,
>>> longitude=151.215297,
>>> terrain_shading=True,
>>> output_parameters=['ghi', 'clearsky_ghi', 'snow_soiling_rooftop'],
>>> api_key="your-key"
>>> )

do not matter because they will be mapped to *_clear(?)

I think the variable name on the left is external and right is pvlib internal, but then it looks like *_clear was already there before it was used in these functions in pvlib...? I might have misunderstood something here.

Can someone advise whether additional revisions are needed?

@kandersolar
Copy link
Member

Thanks for checking. I think no action is needed in iotools then.

Shall any .. deprecated or .. versionchanged directives be used? I'm +1 for the latter, I have the mild impression the former is for complete removals.

Yes, I think so. Right now the docstring doesn't have any indication that the name changed. I like how @echedey-ls did it here: https://github.com/echedey-ls/pvlib-python/blob/1eb44a5d5788b398ae3333ae5f96a04df6567dea/pvlib/solarposition.py#L1351-L1356

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. Any comments from others (@echedey-ls?)

Copy link
Contributor

@echedey-ls echedey-ls left a comment

Choose a reason for hiding this comment

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

LGTM too!

@echedey-ls
Copy link
Contributor

echedey-ls commented Dec 7, 2024

After some thought, I think stating the version when the legacy param names will be removed (clarifying edit: in the docstring admonition) would be useful, but neither essential nor a blocker for merging this PR. We can do that in the future or after taking care of #2325.

@kandersolar kandersolar merged commit f8f60f4 into pvlib:main Dec 10, 2024
26 checks passed
@RDaxini RDaxini deleted the dni_clear branch December 10, 2024 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants