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 PEP 8 compliant api, and add deprecation warnings to camel case api methods. #55

Merged
merged 11 commits into from
Dec 16, 2023

Conversation

AndKaminer
Copy link
Contributor

The camel case python API does not follow PEP 8, and I found it a little tricky to tell between scala and python methods. To fix this, I added new, duplicate methods, that follow (in my opinion) pythonic naming convention. Some of the duplicate methods can be seen below:

Screenshot from 2023-12-14 17-03-38

I also added a deprecated_api_warning method to utils.py.
Screenshot from 2023-12-14 17-04-07

I then stuck it in to every camel case method.
Screenshot from 2023-12-14 17-03-05

Potential follow ups:

  • Remove any actual functionality from the camel case API and have them just be wrapper functions for the snake case methods that throw up a warning when used.
  • Implement more elegant warning logging
  • Something else?

Any feedback would be greatly appreciated!

Copy link
Collaborator

@MarcCote MarcCote left a comment

Choose a reason for hiding this comment

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

That looks good to me. I added others things that can be done to improve the framework (see #54 (comment)).

I think setting up a Github Action to run the (very) few tests we have would be the next step. Along with another that runs flake8 on the Python code.

@MarcCote MarcCote merged commit d4d615c into allenai:main Dec 16, 2023
1 check passed
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.

3 participants