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

Remove api layers #108

Merged
merged 6 commits into from
Jul 2, 2019
Merged

Remove api layers #108

merged 6 commits into from
Jul 2, 2019

Conversation

mahircg
Copy link
Contributor

@mahircg mahircg commented May 20, 2019

No description provided.

@mahircg mahircg requested a review from luisremis May 20, 2019 15:37
@mahircg
Copy link
Contributor Author

mahircg commented May 20, 2019

without_video_merge.log
with_image_merge.log
with_video_merge.log
without_image_merge.log

I'm also attaching the logs for unit-test execution before and after merging the classes.

luisremis
luisremis previously approved these changes Jun 7, 2019
Copy link
Contributor

@luisremis luisremis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Philip we will take a look and we are good to merge.
All tests passing in my system.

src/vcl/Image.cc Outdated Show resolved Hide resolved
include/vcl/Video.h Outdated Show resolved Hide resolved
@mahircg mahircg force-pushed the remove_api_layers branch 2 times, most recently from 704db7e to df9177e Compare June 14, 2019 08:06
@philiplantz
Copy link

The commit message for commit e8cd292 mentions commit ea80b48, which has changed (and will presumably change again). Perhaps it would be better to remove the commit id from the message, and say "a prior commit".

@mahircg
Copy link
Contributor Author

mahircg commented Jun 20, 2019

The commit message for commit e8cd292 mentions commit ea80b48, which has changed (and will presumably change again). Perhaps it would be better to remove the commit id from the message, and say "a prior commit".

Agreed, I'll edit it

@philiplantz
Copy link

philiplantz commented Jun 20, 2019 via email

@vishakha041
Copy link
Contributor

Are these all the latest commits or are there pending changes based on Luis/Philip's comments? Just want to make sure I review the latest code. Thanks.

@mahircg
Copy link
Contributor Author

mahircg commented Jun 24, 2019

Are these all the latest commits or are there pending changes based on Luis/Philip's comments? Just want to make sure I review the latest code. Thanks.

I haven't done the changes pointed out by Luis/Philip yet. Since those are rather small changes, the code won't change drastically once the changes are applied. I'd say it's good to go with the review.

Thanks

include/vcl/Image.h Outdated Show resolved Hide resolved
include/vcl/Image.h Outdated Show resolved Hide resolved
include/vcl/Image.h Outdated Show resolved Hide resolved
include/vcl/Image.h Outdated Show resolved Hide resolved
include/vcl/Image.h Outdated Show resolved Hide resolved
SConstruct Show resolved Hide resolved
include/vcl/Image.h Show resolved Hide resolved
include/vcl/Image.h Show resolved Hide resolved
src/vcl/Image.cc Show resolved Hide resolved
src/vcl/Image.cc Show resolved Hide resolved
tests/SConscript Show resolved Hide resolved
tests/unit_tests/Image_test.cc Show resolved Hide resolved
include/vcl/Video.h Show resolved Hide resolved
tests/SConscript Show resolved Hide resolved
@mahircg mahircg force-pushed the remove_api_layers branch from df9177e to b0398bb Compare June 26, 2019 22:17
@philiplantz
Copy link

philiplantz commented Jun 26, 2019

Vishakha and I had both commented that any API changes to the Image class should be separate from the Image/ImageData merge. But I had missed the fact that the body of the ImageData constructor was incorporated into Image as part of the merge and that the ImageData constructor already supported deep/shallow copy, so that capability naturally gets pulled in to Image as part of the merge.
The only other API change was the addition of the default constructor, which has been made private, so it isn't actually an API change.
So I think I'm now okay with not making a separate commit for API changes.

@luisremis
Copy link
Contributor

I can't respond to this directly for some reason: #108 (comment)

We will do a separate patch for that, not really a good reason not to other than video and images are high priority now. I will remove the separation on the feature vector implementation later and also add fixes that I have in my local branches as well.

@vishakha041
Copy link
Contributor

I don't think github will send an email if you update the branch here. So please let us know whenever you are done so we can approve the PR. It should be good since you have applied all the changes.

luisremis
luisremis previously approved these changes Jun 28, 2019
Copy link
Contributor

@luisremis luisremis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All comments addressed, looks good to go to me!

@@ -67,7 +67,6 @@ def buildServer(env):
'src/vcl/Image.cc',
'src/vcl/TDBImage.cc',
'src/vcl/Video.cc',
'src/vcl/VideoData.cc',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you not face the VideoData test problem here?

Copy link
Contributor

@luisremis luisremis Jul 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, because video testing is more on interface methods only. We can add more testing in the future of course.

@@ -36,7 +36,6 @@ test_sources = ['main.cc',
'unit_tests/TDBImage_test.cc',
'unit_tests/Image_test.cc',
'unit_tests/Video_test.cc',
'unit_tests/VideoData_test.cc',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message here still has a commit Id

vishakha041
vishakha041 previously approved these changes Jul 1, 2019
Copy link
Contributor

@vishakha041 vishakha041 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good sans two minor things. It would be nice to separate out operations next.

mahircg added 6 commits July 2, 2019 10:38
Unit test for ImageData class is removed, as the class itself will be
refactored and merged into the Image class.

Signed-off-by: mahircg <[email protected]>
This patch consolidates ImageData and Image classes into the Image
class, and removes ImageData class.

Signed-off-by: Mahircan Guel <[email protected]>
Currently, move constructor of Image class calls the copy-constructor.
This causes creating redundant copies of move constructor's rhs
argument, particularly for _operations vector and TDBImage object.

This patch eliminates copying by calling std::move on operations,
and assigning _tdb pointer without copying the content.

Signed-off-by: mahircg <[email protected]>
ImageData and Image classes are merged into a single class in a prior
commit. Similarly, this patch moves the tests from ImageData_test
class to Image_test class.

Number of total tests are reduced from 60 (#ImageClass_test + #Image_test)
to 53. This is due to duplicate tests that are removed. Below is a list
of tests that are removed, and the tests they're replaced with.

======================================================
|      Removed            |      Replaced with       |
======================================================
|ImageData_test           | Image_test               |
------------------------------------------------------
|GetImageIDandImageFormat | GetMatFromTDB            |
|GetImageDimensions       | GetImageDimensions       |
|GetEncodedBuffer         | EncodedImage             |
|CreateUnique             | CreateNamePNG            |
======================================================

The remaining 3 tests had the same name in both files, so they're not
shown in the list.

Signed-off-by: mahircg <[email protected]>
VideoData class was used as a wrapper around Video class which was
maintained in a seperate repository, but not any longer. Since Video
class is part of the VDMS codebase, abstraction layer provided by
VideoData is redundant.

This patch combines VideoData and Video classes into the Video class to
remove the interface layer in between.

Signed-off-by: mahircg <[email protected]>
Since VideoData and Video classes are merged into a single class in
a prior commit, testing a single module by two different unit tests is
redundant.

This patch moves the tests from VideoData_test class into Video_test
class. Unit tests of Video class are either complementary
or duplicate across the two test classes.
Thus, the tests are mainly moved from
VideoData_test to Video_test.

Signed-off-by: mahircg <[email protected]>
@luisremis
Copy link
Contributor

Fixed the last commit message. Good to go!

@luisremis luisremis merged commit 3623857 into develop Jul 2, 2019
@luisremis luisremis deleted the remove_api_layers branch July 2, 2019 20:33
cwlacewe added a commit to cwlacewe/vdms that referenced this pull request Apr 14, 2023
* Add files to update pypi package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants