Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: Add a__dict__ to ufunc objects and allow overriding__doc__#27735

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ngoldbaum merged 7 commits intonumpy:mainfrommtsokol:ufunc-object-dict
Nov 13, 2024

Conversation

mtsokol
Copy link
Member

Hi@ngoldbaum,@mhvk,

This PRfixes#26233 and replaces#27383 (with existing review comments applied).

… `__doc__`Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Copy link
Contributor

@mhvkmhvk left a comment

Choose a reason for hiding this comment

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

Apart from the nitpick on the tests, this looks great!

Copy link
Member

@sebergseberg left a comment

Choose a reason for hiding this comment

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

FWIW, looks fine to me as well, but also some comments. I mostly still think that we should also note other things like module and qualname (which have very clear use-cases as well).

@mtsokolmtsokolforce-pushed theufunc-object-dict branch 3 times, most recently fromccdeffb to1aae07dCompareNovember 12, 2024 13:37
@ngoldbaum
Copy link
Member

As a followup we should probably set__module__ on all of NumPy's built-in ufuncs so they show up where they're supposed to be in the public API instead of_multiarray_umath

mtsokol reacted with thumbs up emoji

@ngoldbaum
Copy link
Member

Maybe we can sneak in a deprecation warning into_add_newdoc_ufunc in this PR? It’s innp._core but we told people to continue using it because of the issue fixed by this PR.

mtsokol reacted with thumbs up emoji

@mtsokol
Copy link
MemberAuthor

Maybe we can sneak in a deprecation warning into_add_newdoc_ufunc in this PR?

@ngoldbaum Done!

I think all is ready now.

``__qualname__``.

* ``_add_newdoc_ufunc`` is now deprecated. ``ufunc.__doc__ = newdoc`` should
be used instead.
Copy link
Member

Choose a reason for hiding this comment

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

Nit, but it should be split into two files (different categories).

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Ah right, done!

@mattip
Copy link
Member

We discussed this at the triage meeting and would like to see it merged in.

@ngoldbaum
Copy link
Member

I gave the C code another once-over and I think this is correct. I'll merge now. We should definitely update the way we set docstrings internally to make use of this as a followup, fixing#10167 too.

@ngoldbaumngoldbaum merged commit4df0561 intonumpy:mainNov 13, 2024
69 checks passed
@mtsokolmtsokol deleted the ufunc-object-dict branchNovember 13, 2024 18:42
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@sebergsebergseberg left review comments

@mhvkmhvkmhvk approved these changes

Assignees

@mtsokolmtsokol

Projects
None yet
Milestone
2.2.0 release
Development

Successfully merging this pull request may close these issues.

ENH: add __dict__ to the ufunc object
5 participants
@mtsokol@ngoldbaum@mattip@seberg@mhvk

[8]ページ先頭

©2009-2025 Movatter.jp