-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Added __repr__ attribute to GeneralizedRCNNTransform #1834
Conversation
Added more details to default __repr__ attribute for printing.
Switched strings with syntax to f-strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Can you also add some basic tests, to ensure that the printing gives correct results?
They can go in test_models.py
for example
Checked integrity of __repr__ attribute
Codecov Report
@@ Coverage Diff @@
## master #1834 +/- ##
=========================================
- Coverage 0.43% 0.43% -0.01%
=========================================
Files 92 92
Lines 7388 7396 +8
Branches 1112 1113 +1
=========================================
Hits 32 32
- Misses 7348 7356 +8
Partials 8 8
Continue to review full report at Codecov.
|
Fixed the formatted strings in the __repr__ integrity check for GeneralizedRCNNTransform
Thanks for the test! Tests for Python 3.5 are failing, probably because f-strings have been introduced in Python 3.6. Can you fix this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment, tests are failing due to f-strings
Switched back f-strings to .format syntax for Python3.5 compatibility.
Fixed multiple-line string syntax for compatibility
Fixed formatting of min_size argument of the resizing part
@fmassa I have no clue why the coverage of inception has changed, but all the other tests are passing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The coverage for inception is probably a false positive.
* feat: Added __repr__ attribute to GeneralizedRCNNTransform Added more details to default __repr__ attribute for printing. * fix: Put back relative imports * style: Fixed pep8 compliance Switched strings with syntax to f-strings. * test: Added test for GeneralizedRCNNTransform __repr__ Checked integrity of __repr__ attribute * test: Fixed unittest for __repr__ Fixed the formatted strings in the __repr__ integrity check for GeneralizedRCNNTransform * fix: Fixed f-strings for earlier python versions Switched back f-strings to .format syntax for Python3.5 compatibility. * fix: Fixed multi-line string Fixed multiple-line string syntax for compatibility * fix: Fixed GeneralizedRCNNTransform unittest Fixed formatting of min_size argument of the resizing part
This PR aims at:
__repr__
attribute to theGeneralizedRCNNTransform
classSuggestions are welcomed for the proposed formatting!
See #1786