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

Add a way to retrieve the standard-compliant namespace, fill "how to adopt" and "future evolution" #156

Merged
merged 2 commits into from
May 3, 2023

Conversation

rgommers
Copy link
Member

@rgommers rgommers commented Apr 27, 2023

All this is taken over from the array API standard, where the approach is now stable and the kinks have been worked out.

Closes gh-115
Closes gh-79

Taken over from the array API standard approach
Also largely taken over from the array API standard, with changes
for the process and the smaller scope.
@rgommers rgommers added the documentation Improvements or additions to documentation label Apr 27, 2023
@rgommers rgommers mentioned this pull request Apr 27, 2023
Copy link
Contributor

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Looks fine

to be able to define concat as a function, rather than as a dataframe method, could we also add something like a spec/API_specification/dataframe_api/namespace.py file in which to define functions such as concat?

@rgommers
Copy link
Member Author

to be able to define concat as a function, rather than as a dataframe method, could we also add something like a spec/API_specification/dataframe_api/namespace.py file in which to define functions such as concat?

You can add content to __init__.py and list it in index.rst, like I did for null in gh-157. That should be simple enough I think; I suggest keeping it like that unless we are accumulating an unexpectedly large number of objects in the top-level namespace.

@rgommers
Copy link
Member Author

rgommers commented May 3, 2023

This got two approvals and no unaddressed comments, so I'll hit the green button here.

@rgommers rgommers merged commit cc07b49 into data-apis:main May 3, 2023
@rgommers rgommers deleted the add-a-namespace branch May 3, 2023 20:16
Comment on lines +291 to +293
approach to check for compliance is by checking whether a dataframe object has
an `__dataframe_namespace__` attribute, as this is the one distinguishing
feature of a dataframe-compliant object.
Copy link
Member

@jorisvandenbossche jorisvandenbossche May 11, 2023

Choose a reason for hiding this comment

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

In #115 (comment) you mentioned having this attribute on a non-compliant DataFrame object, as a way to go from that to a compliant one (unless I misunderstood the comment), which would not make this a fully correct check.

In general, this pathway seems missing in the current description? Assume you have written a function to work with a spec compliant dataframe API, is it then up to the user of your library to only pass such dataframes, or do we want a way that the function can check for any dataframe input if it can give in a compliant version of itself?

Copy link
Member Author

@rgommers rgommers May 11, 2023

Choose a reason for hiding this comment

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

Great catch, thanks Joris. We already have DataFrame.dataframe to get back out the user-facing/non-compliant one, but we indeed do need to add the conversion the other way.

Let me open a follow-up issue right now, since I won't get to fixing that up today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to enable the Standard? How to make a future dataframe API available?
4 participants