Skip to content

Conversation

@seisman
Copy link
Member

@seisman seisman commented Dec 27, 2023

Description of proposed changes

As mentioned in #962 (comment), this PR changes wrap-summaries and wrap-descriptions to 88 and reformat all docstrings. Please note that descriptions are not re-wrapped due to known docformatter limitations.

Address #962. Related to a follow-up PR #2925.

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog labels Dec 27, 2023
@seisman seisman added this to the 0.11.0 milestone Dec 27, 2023
@seisman seisman added the needs review This PR has higher priority and needs review. label Dec 27, 2023
Copy link
Member

@yvonnefroehlich yvonnefroehlich left a comment

Choose a reason for hiding this comment

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

Hm, when running make format locally on this branch, it finds a few docstrings which seem to be not updated yet:

(pygmt) yfroe@gpiseis16:~/Documents/01_GitHub/github_pygmt/pygmt> make format
docformatter --in-place pygmt doc/conf.py examples
ruff check --fix pygmt doc/conf.py examples
ruff format pygmt doc/conf.py examples
282 files left unchanged

(pygmt) yfroe@gpiseis16:~/Documents/01_GitHub/github_pygmt/pygmt> git diff
diff --git a/pygmt/__init__.py b/pygmt/__init__.py
index 0d22a604..6c98248a 100644
--- a/pygmt/__init__.py
+++ b/pygmt/__init__.py
@@ -80,8 +80,8 @@ def print_clib_info(file=sys.stdout):
     """
     Print information about the GMT shared library that we can find.

-    Includes the GMT version, default values for parameters, the path to the
-    ``libgmt`` shared library, and GMT directories.
+    Includes the GMT version, default values for parameters, the path to the ``libgmt``
+    shared library, and GMT directories.
     """
     from pygmt.clib import Session

diff --git a/pygmt/helpers/decorators.py b/pygmt/helpers/decorators.py
index 2db4784f..8c60afe1 100644
--- a/pygmt/helpers/decorators.py
+++ b/pygmt/helpers/decorators.py
@@ -2,8 +2,7 @@
 Decorators to help wrap the GMT modules.

 Apply them to functions wrapping GMT modules to automate: alias generation for
-arguments, insert common text into docstrings, transform arguments to strings,
-etc.
+arguments, insert common text into docstrings, transform arguments to strings, etc.
 """
 import functools
 import textwrap
diff --git a/pygmt/session_management.py b/pygmt/session_management.py
index 4bb82983..6d935175 100644
--- a/pygmt/session_management.py
+++ b/pygmt/session_management.py
@@ -23,10 +23,10 @@ def end():
     """
     Terminate GMT modern mode session and optionally produce the figure files.

-    Called after :func:`pygmt.begin` and all commands that you want included in
-    a session. Will finalize any PostScript plots that were made in the
-    background, convert them to the desired format (specified in

-    ``pygmt.begin``), and bring the figures to the working directory.
+    Called after :func:`pygmt.begin` and all commands that you want included in a
+    session. Will finalize any PostScript plots that were made in the background,
+    convert them to the desired format (specified in ``pygmt.begin``), and bring the
+    figures to the working directory.
     """
     with Session() as lib:
         lib.call_module(module="end", args="")
diff --git a/pygmt/tests/test_grdgradient.py b/pygmt/tests/test_grdgradient.py
index 879be7fb..20536230 100644
--- a/pygmt/tests/test_grdgradient.py
+++ b/pygmt/tests/test_grdgradient.py
@@ -75,8 +75,8 @@ def test_grdgradient_fails(grid):
     """
     Check that grdgradient fails correctly.

-    Check that grdgradient fails correctly when `tiles` is specified but
-    normalize is not.
+    Check that grdgradient fails correctly when `tiles` is specified but normalize is
+    not.
     """
     with pytest.raises(GMTInvalidInput):
         grdgradient(grid=grid)  # fails without required arguments

@seisman
Copy link
Member Author

seisman commented Dec 28, 2023

Maybe you're using an old version of docformatter?

@GenericMappingTools GenericMappingTools deleted a comment from codspeed-hq bot Dec 28, 2023
@yvonnefroehlich
Copy link
Member

Maybe you're using an old version of docformatter?

Ah, you are right! After updating to docformatter 1.7.5, these violations are no longer reported.

@seisman seisman requested a review from a team January 1, 2024 11:02
@seisman seisman removed the needs review This PR has higher priority and needs review. label Jan 2, 2024
@seisman seisman merged commit da36673 into main Jan 2, 2024
@seisman seisman deleted the docformatter/88-char branch January 2, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants