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

Integrate nested callable and getcallable #3691

Merged
merged 3 commits into from
Jun 19, 2022

Conversation

muellerzr
Copy link
Contributor

Integrate Nested Callable from fastcore

What does this add?

This PR merges the recent nested callable addition to fastcore into fastai.

Why is it needed?

The fastai codebase has multiple counts of a duplicated pattern:

getattr(obj, name, noop)()

We can instead use getcallable and nested_callable to remove that noop and call it implicitly.

This PR also changes in_channels to return the right StopIteration exception and just modifies the message, rather than a raw Exception class.

What parts of the API does this impact?

User-facing:

Nothing they will see

Internal structure:

All instances following the above pattern have been replaced with nested_callable or getcallable

cc @jph00

@muellerzr muellerzr requested a review from jph00 as a code owner June 16, 2022 10:51
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@muellerzr muellerzr changed the title Integrate nested callable Integrate nested callable and getcallable Jun 16, 2022
@jph00 jph00 merged commit 9a2cb0f into fastai:master Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants