Skip to content

Deprecate modelchain.basic_chain#1401

Merged
wholmgren merged 4 commits into
pvlib:masterfrom
kandersolar:basic_chain
Feb 16, 2022
Merged

Deprecate modelchain.basic_chain#1401
wholmgren merged 4 commits into
pvlib:masterfrom
kandersolar:basic_chain

Conversation

@kandersolar

Copy link
Copy Markdown
Member
  • [ ] Closes #xxxx
  • I am familiar with the contributing guidelines
  • Tests added
  • 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 and Milestone are assigned to the Pull Request and linked Issue.

See #1385 (comment)

Do we remove functions from the API listing at deprecation or at removal? SingleAxisTracker and some other deprecated things are currently listed, so I've not removed basic_chain here.

@kandersolar kandersolar added this to the 0.9.1 milestone Feb 9, 2022
@mikofski

mikofski commented Feb 9, 2022

Copy link
Copy Markdown
Member

I think there is some Sphinx “deprecated” directive, and also like “new since vX.Y” — I think we should use that:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html

@kandersolar

Copy link
Copy Markdown
Member Author

Yes there is! Our nice @deprecated decorator actually automatically inserts it into the docstring, so no need for us to do it manually:

new_doc = (('\n.. deprecated:: %(since)s'
'\n %(message)s\n\n' %
{'since': since, 'message': message}) + old_doc)

Result:

image

and

image

@wholmgren

Copy link
Copy Markdown
Member

Do we remove functions from the API listing at deprecation or at removal? SingleAxisTracker and some other deprecated things are currently listed, so I've not removed basic_chain here.

Yes, I think we should and that we have in the past.

@cwhanse

cwhanse commented Feb 9, 2022

Copy link
Copy Markdown
Member

Do we remove functions from the API listing at deprecation or at removal?

I favor removal at removal. If a user gets a deprecation message, they may want to look at the old documentation as part of their migration work. Removing it from the API listing makes it a bit harder to find.

@cwhanse cwhanse left a comment

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.

Thanks @kanderso-nrel My preference for retaining documentation until removal is not a blocker if the majority feels otherwise.

@wholmgren wholmgren left a comment

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.

ModelChain.with_sapm is a more direct replacement for basic_chain, so should we also/alternatively recommend that to users in the what's new and deprecation message?

@wholmgren wholmgren merged commit 93e8404 into pvlib:master Feb 16, 2022
@kandersolar kandersolar deleted the basic_chain branch February 16, 2022 20:13
@kandersolar kandersolar added api deprecation Use for issues and PRs which involve deprecations labels Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api deprecation Use for issues and PRs which involve deprecations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants