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

Refactor Datumaro format code and test code #824

Merged
merged 9 commits into from
Feb 27, 2023

Conversation

vinnamkim
Copy link
Contributor

@vinnamkim vinnamkim commented Feb 23, 2023

Summary

  • Related ticket: 104694
  • This PR is required as a pre-work for the Datumaro binary format implementation task (104650). It will refactor Datumaro format to make a room for Datumaro binary format implementation.
  • This also migrate our testing framework from unittest to pytest in Datumaro unit test code. Please see the reason why we move on as follows.

Currently, Datumaro uses old-fashioned unittest framework and its unit test codes has been time-worn so much. There have been super many duplicated and never re-use codes in our tests. In addition, if we keep using unittest, it is expected that the spaghetti with no taste will continue to grow its size bigger and bigger. This epic aims to migrate our testing framework from unittest to pytest. Appropriate code refactoring and use of pytest fixtures can slim down our testing code.


How to test

This PR's test refactoring will cover.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim vinnamkim changed the title Refactor/datumaro format Refactor Datumaro format code and test code Feb 23, 2023
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim vinnamkim marked this pull request as ready for review February 23, 2023 11:28
@vinnamkim vinnamkim added ENHANCE Enhancement of existing features data formats PR is related to dataset formats infra labels Feb 23, 2023
@vinnamkim vinnamkim added this to the 1.1.0 milestone Feb 23, 2023
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
Signed-off-by: Kim, Vinnam <vinnam.kim@intel.com>
@vinnamkim vinnamkim added refactoring TEST Any changes in tests and removed ENHANCE Enhancement of existing features infra labels Feb 24, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2023

Codecov Report

Base: 78.27% // Head: 78.33% // Increases project coverage by +0.06% 🎉

Coverage data is based on head (e936086) compared to base (a3bd7de).
Patch coverage: 96.87% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #824      +/-   ##
===========================================
+ Coverage    78.27%   78.33%   +0.06%     
===========================================
  Files          184      189       +5     
  Lines        23614    23681      +67     
  Branches      4892     4895       +3     
===========================================
+ Hits         18484    18551      +67     
  Misses        4032     4032              
  Partials      1098     1098              
Flag Coverage Δ
macos-11_Python-3.8 77.64% <96.87%> (+0.06%) ⬆️
ubuntu-20.04_Python-3.8 78.31% <96.87%> (+0.05%) ⬆️
windows-2019_Python-3.8 78.25% <96.87%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
...o/plugins/data_formats/datumaro_binary/importer.py 86.66% <86.66%> (ø)
datumaro/plugins/data_formats/datumaro/exporter.py 93.02% <93.33%> (+0.06%) ⬆️
datumaro/components/importer.py 89.68% <100.00%> (+0.25%) ⬆️
datumaro/plugins/data_formats/datumaro/base.py 92.96% <100.00%> (-0.65%) ⬇️
datumaro/plugins/data_formats/datumaro/format.py 100.00% <100.00%> (ø)
datumaro/plugins/data_formats/datumaro/importer.py 100.00% <100.00%> (ø)
...umaro/plugins/data_formats/datumaro_binary/base.py 100.00% <100.00%> (ø)
...o/plugins/data_formats/datumaro_binary/exporter.py 100.00% <100.00%> (ø)
...aro/plugins/data_formats/datumaro_binary/format.py 100.00% <100.00%> (ø)
datumaro/util/test_utils.py 85.29% <100.00%> (+1.16%) ⬆️
... and 2 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vinnamkim vinnamkim added this pull request to the merge queue Feb 27, 2023
Merged via the queue into openvinotoolkit:develop with commit 79b9eb1 Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data formats PR is related to dataset formats refactoring TEST Any changes in tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants