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

Inheriting docstrings from Pandas in python >= 3.5 #239

Open
AdamOrmondroyd opened this issue Oct 13, 2022 · 1 comment
Open

Inheriting docstrings from Pandas in python >= 3.5 #239

AdamOrmondroyd opened this issue Oct 13, 2022 · 1 comment
Labels
docs Documentation upgrades
Milestone

Comments

@AdamOrmondroyd
Copy link
Collaborator

AdamOrmondroyd commented Oct 13, 2022

For python >= 3.5, if an overridden function lacks a docstring, then it looks up the inheritance tree to find one.

For example, if one were to delete the docstring from anesthetic.weighted_pandas.WeightedDataFrame.quantile(), then instead we would see the docstring from Pandas through help() or in an IDE such as VS Code.

import anesthetic as ac
ns = ac.read_chains("anesthetic/tests/example_data/pc")
help(ns.quantile)

195666578-6f9fcf8d-6a8a-4246-ae97-20936d15576e

Perhaps it would be good to make use of this in anesthetic?

@lukashergt
Copy link
Collaborator

lukashergt commented Oct 13, 2022

Thanks for pointing this out! This might resolve (part of) #22.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation upgrades
Projects
None yet
Development

No branches or pull requests

3 participants