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

feat: auto coerce dataframes #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: auto coerce dataframes #44

wants to merge 1 commit into from

Conversation

manzt
Copy link
Collaborator

@manzt manzt commented Sep 21, 2023

Right now you need to create an Embeddings from a dataframe to use the EmbeddingComparisonWidget. This PR lets you pass in dataframes as well, and will select the x, y, label, robust (option) columns to create the Embedding object.

Comment on lines +61 to +62
left_embedding: Embedding | pd.DataFrame,
right_embedding: Embedding | pd.DataFrame,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this backwards compatible with Python versions before 11?

Copy link
Collaborator Author

@manzt manzt Sep 25, 2023

Choose a reason for hiding this comment

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

Yes, the top of the file uses:

from __future__ import annotations

Which tells Python to treat everything after the : in types as comments. We only use for static type checking, so this allows us to use modern syntax. If we needed to inspect the types at runtime (e.g., using pydantic in this file), we'd want to avoid using __future__ annotations imports and find a typing syntax that is backward compatbile.

@manzt manzt force-pushed the main branch 5 times, most recently from 2406222 to acad765 Compare October 17, 2024 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants