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

Figure.text: Deprecate parameter "incols" to "use_word" (remove in v0.10.0) #1964

Merged
merged 19 commits into from
Nov 18, 2022
Merged

Figure.text: Deprecate parameter "incols" to "use_word" (remove in v0.10.0) #1964

merged 19 commits into from
Nov 18, 2022

Conversation

yvonnefroehlich
Copy link
Member

Description of proposed changes

Fixes #1947

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

pygmt/src/text.py Outdated Show resolved Hide resolved
@seisman seisman added this to the 0.8.0 milestone Jun 23, 2022
@seisman seisman added the enhancement Improving an existing feature label Jun 23, 2022
@yvonnefroehlich
Copy link
Member Author

I think we will go with use_word.

@yvonnefroehlich Please make the changes when you have time.

I started working on this. At the moment the deprecation cycle includes (only) two minor releases, starting at 0.8.0 and ending at 1.0.0 (not 0.10.0 corresponding to the announcement draft). I am unsure about how to

  • change i to it or add the t later/externally.
  • change the format from string to integer (the docstring is already adjusted corresponding to use_word=<integer>).
  • write a test as proposed in the Maintainers Guide.

@yvonnefroehlich yvonnefroehlich changed the title Replace -i placeholder with -it docstring in pygmt.Figure.text() Rename 'incols' to 'use_word' in pygmt.Figure.text() Jul 2, 2022
@yvonnefroehlich yvonnefroehlich changed the title Rename 'incols' to 'use_word' in pygmt.Figure.text() Rename incols to use_word in pygmt.Figure.text() Jul 2, 2022
pygmt/src/text.py Outdated Show resolved Hide resolved
@seisman
Copy link
Member

seisman commented Jul 7, 2022

  • change i to it or add the t later/externally.

I think changing i to it is easier.

  • change the format from string to integer (the docstring is already adjusted corresponding to use_word=<integer>).

Yes.

pygmt/src/text.py Outdated Show resolved Hide resolved
@seisman seisman changed the title Rename incols to use_word in pygmt.Figure.text() Figure.text: Deprecate parameter "incols" to "use_word" (remove in v0.10.0) Nov 13, 2022
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

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

Do you think we should add a test for it?

Copy link
Contributor

@willschlitzer willschlitzer left a comment

Choose a reason for hiding this comment

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

Not necessary for just the deprecation of a parameter, but could a new test be written or an existing test modified to include this new parameter? I think it might be good to make sure that text is consistently reading a string from an input file.

@seisman
Copy link
Member

seisman commented Nov 18, 2022

Not necessary for just the deprecation of a parameter, but could a new test be written or an existing test modified to include this new parameter? I think it might be good to make sure that text is consistently reading a string from an input file.

Yes, I agree. This can be done in a separate PR.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Nov 18, 2022
@willschlitzer willschlitzer merged commit 9b1e7f1 into GenericMappingTools:main Nov 18, 2022
@willschlitzer willschlitzer removed the final review call This PR requires final review and approval from a second reviewer label Nov 18, 2022
@yvonnefroehlich yvonnefroehlich deleted the update-text-doc-incols branch November 18, 2022 14:44
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
….10.0) (GenericMappingTools#1964)

* Rename 'incols' to 'use_word'
* Replace -i placeholder with -it docstring
* Add 'deprecate_parameter' for two minor releases
* Remove 'i' or 'it' from 'kwargs_to_strings'
* Adjust docstring corresponding to 'use_word=<integer>'

Co-authored-by: Dongdong Tian <[email protected]>
@seisman seisman added deprecation Deprecating a feature and removed enhancement Improving an existing feature labels Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Deprecating a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pygmt.Figure.text(): incols (-i) parameter does not work as described in the documentation
4 participants