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: add example stubs #12679

Merged
merged 7 commits into from
Jul 6, 2023
Merged

feat: add example stubs #12679

merged 7 commits into from
Jul 6, 2023

Conversation

bdura
Copy link
Contributor

@bdura bdura commented May 26, 2023

Description

This PR adds a stubs file for spacy.training.example. It also fixes a few typing-related issues.

Types of change

This is an enhancement.

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.
  • I ran the tests, and all new and existing tests passed.
  • My changes don't require a change to the documentation, or if they do, I've added all required information.

@bdura bdura added the enhancement Feature requests and improvements label May 26, 2023
@bdura
Copy link
Contributor Author

bdura commented May 26, 2023

I only added evident type hints. I'll add those later on, either in this PR or the next - let me know what works best since I'll likely have little time for that in the next few days.

@svlandeg svlandeg added the types Issues related to typing or typing tools label Jul 6, 2023
@svlandeg svlandeg merged commit 30bb345 into explosion:master Jul 6, 2023
@svlandeg svlandeg mentioned this pull request Jul 6, 2023
3 tasks
svlandeg added a commit that referenced this pull request Jul 6, 2023
@svlandeg svlandeg mentioned this pull request Jul 6, 2023
3 tasks
@@ -19,14 +20,19 @@
FILE_TYPE = ".spacy"


class ReaderProtocol(Protocol):
def __call__(self, nlp: "Language") -> Iterable[Example]:
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought Iterator[Example] was correct throughout here?

Copy link
Member

Choose a reason for hiding this comment

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

Answered here.

@svlandeg svlandeg mentioned this pull request Jul 6, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and improvements types Issues related to typing or typing tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants