Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Simplify input transform object #1340

Merged
merged 8 commits into from
Jun 30, 2022
Merged

Conversation

ethanwharris
Copy link
Collaborator

@ethanwharris ethanwharris commented May 10, 2022

What does this PR do?

Makes the following simplifications:

  • Removes the input_ and target_ prefixed versions of the hooks. This massively simplifies the logic around resolving transforms and creates a clear method heirarchy where train, val, test etc. prefixes by default just call to the non-prefixed version. As a result, we can remove all of the is_overridden checks and other resolutions.
  • Removes support for passing a callable. This was not used in our codebase and is not recommended as it's not clear how the callable will be handled.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
    Discuss it here 😃 In this case it was easier to show than tell
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests? [not needed for typos/docs]
  • Did you verify new and existing tests pass locally with your changes?
  • If you made a notable change (that affects users), did you update the CHANGELOG?

PR review

  • Is this pull request ready for review? (if not, please submit in draft mode)

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented May 10, 2022

Codecov Report

Merging #1340 (c6fdf33) into master (ee512a2) will increase coverage by 0.10%.
The diff coverage is 97.56%.

@@            Coverage Diff             @@
##           master    #1340      +/-   ##
==========================================
+ Coverage   92.67%   92.78%   +0.10%     
==========================================
  Files         286      285       -1     
  Lines       12814    12671     -143     
==========================================
- Hits        11876    11757     -119     
+ Misses        938      914      -24     
Flag Coverage Δ
unittests 92.78% <97.56%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
flash/core/data/io/input_transform.py 93.59% <95.74%> (+5.08%) ⬆️
flash/audio/classification/input_transform.py 92.30% <100.00%> (ø)
flash/image/classification/input_transform.py 83.87% <100.00%> (-0.51%) ⬇️
flash/image/face_detection/input_transform.py 100.00% <100.00%> (ø)
flash/image/segmentation/input_transform.py 93.75% <100.00%> (-6.25%) ⬇️
flash/image/style_transfer/input_transform.py 100.00% <100.00%> (ø)
flash/template/classification/data.py 95.77% <100.00%> (-0.12%) ⬇️
flash/text/question_answering/model.py 93.19% <0.00%> (-0.69%) ⬇️
flash/core/serve/dag/task.py 97.88% <0.00%> (+1.05%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee512a2...c6fdf33. Read the comment docs.

@ethanwharris ethanwharris changed the title [RFC] Simplify input transform object Simplify input transform object Jun 30, 2022
@ethanwharris ethanwharris merged commit 323a044 into master Jun 30, 2022
@ethanwharris ethanwharris deleted the refactor/remove_data_pipeline branch June 30, 2022 09:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant