Closed davidelct closed 1 year ago
Hi @davidelct!
Thank you for your pull request and welcome to our community.
In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.
In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed
. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.
If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!
Hi @davidelct, thanks for opening the PR! It looks great! I left a couple of comments, I think that after integrating those it's good to go! Thanks!
hi @robertodessi ! thanks for your suggestions. the following changes have been made to __add__
:
let me know if there is anything else we could add here and thanks for your help !
Hi @davidelct,
Thanks a lot for fixing this! It looked already great to me, but I left a minor minor comment (not sure if it's a typo in the docstring) and two suggestions. What do you think?
Hi @robertodessi, thanks a lot for the suggestions ! They look good to me, I incorporated as follows:
__add__
the aux dicts are now combined with a single function, so as to avoid repetitions in code and to make it consistent with how the rest of the data is combined toodump_interactions
: now removed__add__
a bit more readablethanks !
Thank you!
Thanks for working on EGG and opening a PR! Please fill this template to help us understand what are you introducing in EGG.
Description
__add__
method to theInteraction
dataclassdump_interactions
function to return the full interactioncontinous_communication.py
tocontinuous_communication.py
and all the related imports accordinglyRelated Issue (if any)
dump_interactions
function, which would fail raising the TypeError exception: unsupported operand type(s) for +: 'Interaction' and 'Interaction'.Motivation and Context
The
Interaction
dataclass lacked an__add__
method to control the behavior of the + operator between two interaction objects: this would preventdump_interactions
from accumulating the interaction objects in thefull_interaction
variable. Moreover, thedump_interactions
function returned theinteraction
variable instead of thefull_interaction
. (https://github.com/facebookresearch/EGG/issues/240#issue-1150682221) Thecontinuous_communication.py
file name had a typo. (https://github.com/facebookresearch/EGG/issues/239#issue-1150680172)How Has This Been Tested?
Tested by adding two Interaction objects into a single Interaction, and checked that no data is missing. Tested dump_interactions behavior by checking that it returns the full interaction. Pytest from root dir passes all tests.