-
Notifications
You must be signed in to change notification settings - Fork 60
Function to remove data pack from a multi pack #555
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
Conversation
… tests for bug#544 (enhancement)
…nt's previous error message.
…em (in comments).
line length fixed (black).
line length fixed (black).
line when setting None in array (instead of -1)
…, when setting None in array (instead of -1)
Codecov Report
@@ Coverage Diff @@
## master #555 +/- ##
==========================================
+ Coverage 80.82% 80.90% +0.08%
==========================================
Files 240 240
Lines 17194 17362 +168
==========================================
+ Hits 13897 14047 +150
- Misses 3297 3315 +18
Continue to review full report at Codecov.
|
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.
Since we will change some implementation in pack id, I didn't fully review this. But I added some comments on some other parts.
…"None" type cause a secondary exception issue 3) in multi_pack_test.py member variable to local variable changes per pull request comments from Hector
Please have a review of the new code that fixed the comments issue as suggested. Thanks. |
any updates to the reviews |
…ic would be set to None and which set to empty
Should update branch with master and see if we can pass CI |
Sure will do soon as related things getting clear. Thanks Hector.
James Xiao
Architect
T: +971 2 8113163
E: ***@***.***
www.mbzuai.ac.ae<http://www.mbzuai.ac.ae>
Mohamed bin Zayed University of Artificial Intelligence
Masdar City, Building 1B, 3rd Floor
Abu Dhabi, UAE
[cid:MBZUAI_Logo_4d283c4f-1a0d-4aed-8a25-b17ff8b431f8.png]
The world’s first specialized research-based AI university
…________________________________
发件人: Hector ***@***.***>
发送时间: 2022年2月3日 9:20
收件人: asyml/forte ***@***.***>
抄送: James Xiao ***@***.***>; Author ***@***.***>
主题: Re: [asyml/forte] Function to remove data pack from a multi pack (PR #555)
Should update branch with master and see if we can pass CI
―
Reply to this email directly, view it on GitHub<#555 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWD56G6M64FJ35UXSEZ3PPDUZIGBTANCNFSM5HLYRRAQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
2. Add purge_lists flag to allow automatic purge of list (mainly for expert users that will be aware of related pack indexes changes) as discussed, and related unit test case
This PR fixes #544.
Description of changes
remove_pack(index_of_pack: int, clean_invalid_entries: bool = False) is added with clean_invalid_entries option for removing Cross-Pack links/groups associated with the data pack to be removed. If this flag is false and the pack to be removed have cross-pack links/groups, a ValueError will be raised indicate user the existence of cross pack links/groups with this pack and the need for setting the flag to be true to remove the associated links/groups.
Possible influences of this PR.
Possible side-effects: if directly removed packs from related arrays the index for the elements after that will be changed which will affect those buffered index such as in getChild/getParent. So current solution is to set the element in corresponding arrays as None instead to keep the index of other elements unchanged. A purge function is also added however to compress the array and remove the None in it however this will cause the index of elements after those removed ones being changed.
Test Conducted
Unit test performed for remove single pack, remove pack with cross pack links and groups. Also unit tested purge function.