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

[Train] Replace abc.ABCMeta with abc.ABC in callbacks #21262

Merged
merged 4 commits into from
Jan 3, 2022

Conversation

bveeramani
Copy link
Member

@bveeramani bveeramani commented Dec 25, 2021

Why are these changes needed?

Inheriting from abc.ABC is more readable than setting the meta class to abc.ABCMeta.

Relevant snippet from the Python 3.4 release notes:

New class ABC has ABCMeta as its meta class. Using ABC as a base class has essentially the same effect as specifying metaclass=abc.ABCMeta, but is simpler to type and easier to read. (Contributed by Bruno Dupuis in bpo-16049.)

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@bveeramani bveeramani added the train Ray Train Related Issue label Dec 25, 2021
@bveeramani bveeramani changed the title [Train] Make TrainingCallback inherit from abc.ABC [Train] Replace abc.ABCMeta with abc.ABC in callbacks Jan 1, 2022
@bveeramani
Copy link
Member Author

bveeramani commented Jan 3, 2022

The lint status check is failing because there's apparently a formatting issue with logging.py. I ran ./scripts/format.sh, but it didn't reformat logging.py. I also manually checked the yapf version and ran yapf --style .style.yapf ./python/ray/train/callbacks/logging.py, but it also didn't make any changes. This might be due to some non-deterministic yapf nonsense?

In any case, will debug when I get back from OOO.

Signed-off-by: Richard Liaw <rliaw@berkeley.edu>
@richardliaw
Copy link
Contributor

@bveeramani fixed it for you (the lint ran fine on my computer and generated the right diff)

@amogkam amogkam merged commit 4e8f90a into ray-project:master Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
train Ray Train Related Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants