Skip to content

Commit 1ca0c4e

Browse files
committed
FIX: Fixes
1 parent 1c66689 commit 1ca0c4e

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

numpydoc/docscrape.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -711,23 +711,22 @@ def properties(self):
711711

712712
@staticmethod
713713
def _should_skip_member(name, klass):
714-
if (
714+
return (
715715
# Namedtuples should skip everything in their ._fields as the
716716
# docstrings for each of the members is: "Alias for field number X"
717717
issubclass(klass, tuple)
718718
and hasattr(klass, "_asdict")
719719
and hasattr(klass, "_fields")
720720
and name in klass._fields
721-
):
722-
return True
723-
return False
721+
)
724722

725723
def _is_show_member(self, name):
726-
if self.show_inherited_members:
727-
return True # show all class members
728-
if name not in self._cls.__dict__:
729-
return False # class member is inherited, we do not show it
730-
return True
724+
return (
725+
# show all class members
726+
self.show_inherited_members
727+
# or class member is not inherited
728+
or name in self._cls.__dict__
729+
)
731730

732731

733732
def get_doc_object(

numpydoc/hooks/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def find_project_root(srcs: Sequence[str]):
3131
`Black <https://github.com/psf/black/blob/main/src/black/files.py>`_.
3232
"""
3333
if not srcs:
34-
return Path().resolve(), "current directory"
34+
return Path.cwd(), "current directory"
3535

3636
common_path = Path(
3737
os.path.commonpath([Path(src).expanduser().resolve() for src in srcs])

0 commit comments

Comments
 (0)