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

DOC: add guidance on how to make a dataclass for result objects #18221

Merged
merged 1 commit into from Apr 3, 2023

Conversation

tupui
Copy link
Member

@tupui tupui commented Mar 31, 2023

As noted in #18216 we could describe how to create dataclasses when we create result objects.

cc @WillTirone

@tupui tupui added scipy.stats Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org labels Mar 31, 2023
@tupui tupui added this to the 1.11.0 milestone Mar 31, 2023
@tupui tupui requested review from melissawm and mdhaber March 31, 2023 12:52
@@ -87,6 +87,19 @@ private return classes, please see how `~scipy.stats.binomtest` summarizes
`~scipy.stats._result_classes.BinomTestResult` and links to its documentation,
and note that ``BinomTestResult`` cannot be imported from `~scipy.stats`.

Depending on the complexity of "MyResultObject", a normal class or a dataclass
can be used. When using dataclasses, do not use ``dataclasses.make_dataclass``,
Copy link
Contributor

Choose a reason for hiding this comment

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

Just in case you want to add that reference:

Suggested change
can be used. When using dataclasses, do not use ``dataclasses.make_dataclass``,
can be used. When using dataclasses, do not use :py:func:`dataclasses.make_dataclass`,

Copy link
Contributor

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

I don't object to this idea, and the description and motivation are clear to me. I'll merge with support of a few other maintainers.

@tupui tupui merged commit 2a1a3f0 into scipy:main Apr 3, 2023
6 checks passed
@tupui tupui deleted the doc_dataclasses branch April 3, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants