EnvriPlus-PROV / EnvriProvTemplates

Other
2 stars 3 forks source link

Fixes inconsistent wasAssociatedWith issue #5

Closed neutvd closed 3 years ago

neutvd commented 4 years ago

Hi Doron,

this issue #4 was starting to be a show stopper for us, so we decided to spend some time trying to solve it. Please review and merge if possible. Thank you. Below is a description of what I did.

rel.formal_attributes now determines the order in which matches are found. It seems as if linkedGroups order is not always the same, whereas the order of rel.formal_attributes order is always the same. So reversing the loops makes that the order in which matches are found is now determined by the order of rel.formal_attributes as opposed to linkedGroups.

Also in match there was an issue in which it was possible that ret was not changed from its None initialization, causing append to be called on a None object resulting in an exception. Also turned the order of the tests around, because sometimes an empty list (or None before the ret fix was returned when adr was in mdict and would have returned a value if this test was first, which it now is.

d0rg0ld commented 3 years ago

I found a different solution which I think targets the core problem of this issue (https://github.com/EnvriPlus-PROV/EnvriProvTemplates/commit/27d6b37abba94f09d2f7e3b75522aebc5bca6dff) , I therefore close this pull request and would like to ask you for Testing/feedback on my proposed solution. Thanks, Doron