Skip to content

Commit

Permalink
FIX: Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jul 1, 2024
1 parent 1c66689 commit 1ca0c4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions numpydoc/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,23 +711,22 @@ def properties(self):

@staticmethod
def _should_skip_member(name, klass):
if (
return (
# Namedtuples should skip everything in their ._fields as the
# docstrings for each of the members is: "Alias for field number X"
issubclass(klass, tuple)
and hasattr(klass, "_asdict")
and hasattr(klass, "_fields")
and name in klass._fields
):
return True
return False
)

def _is_show_member(self, name):
if self.show_inherited_members:
return True # show all class members
if name not in self._cls.__dict__:
return False # class member is inherited, we do not show it
return True
return (
# show all class members
self.show_inherited_members
# or class member is not inherited
or name in self._cls.__dict__
)


def get_doc_object(
Expand Down
2 changes: 1 addition & 1 deletion numpydoc/hooks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def find_project_root(srcs: Sequence[str]):
`Black <https://github.com/psf/black/blob/main/src/black/files.py>`_.
"""
if not srcs:
return Path().resolve(), "current directory"
return Path.cwd(), "current directory"

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

0 comments on commit 1ca0c4e

Please sign in to comment.