Improve legacy H5 format test coverage#22665
Improve legacy H5 format test coverage#22665andersendsa wants to merge 2 commits intokeras-team:masterfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request expands the test suite for legacy H5 format saving by adding helper functions and test cases for convolutional, RNN, and embedding models. The review feedback highlights formatting issues such as missing blank lines between methods and trailing whitespace on empty lines.
| tf_keras_model = get_subclassed_model(tf_keras) | ||
| ref_input = np.random.random((2, 3)) | ||
| self._check_reloading_weights(ref_input, model, tf_keras_model) | ||
| def test_conv_model_weights(self): |
There was a problem hiding this comment.
Missing blank line between methods. According to PEP 8 and Keras coding standards, method definitions inside a class should be separated by a single blank line to improve code readability and maintain consistency with the rest of the file.
| def test_conv_model_weights(self): | |
| def test_conv_model_weights(self): |
References
- Following Python conventions (PEP 8), methods should be separated by a single blank line. (link)
| model = get_functional_model(keras) | ||
| ref_input = np.random.random((2, 3)) | ||
| self._check_reloading_model(ref_input, model) | ||
|
|
There was a problem hiding this comment.
Trailing whitespace detected. This line contains indentation spaces but no code. Blank lines should be kept truly empty to avoid unnecessary whitespace churn and adhere to clean coding practices.
References
- Avoid trailing whitespace to maintain clean code formatting. (link)
| legacy_h5_format.save_model_to_hdf5(model, temp_filepath) | ||
| legacy_h5_format.load_model_from_hdf5(temp_filepath) | ||
|
|
||
There was a problem hiding this comment.
Trailing whitespace detected. This line should be a clean blank line without any spaces.
References
- Avoid trailing whitespace to maintain clean code formatting. (link)
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #22665 +/- ##
===========================================
- Coverage 83.15% 64.11% -19.05%
===========================================
Files 596 596
Lines 68858 68858
Branches 10774 10774
===========================================
- Hits 57259 44147 -13112
- Misses 8783 22142 +13359
+ Partials 2816 2569 -247
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Contributor Agreement
Please check all boxes below before submitting your PR for review:
Note: Failing to adhere to this agreement may result in your future PRs no longer being reviewed.