Alter TagSetManager score function to look at preference only#134
Alter TagSetManager score function to look at preference only#134cat-bro wants to merge 3 commits intogalaxyproject:mainfrom
Conversation
|
The current score function takes the int value of the tag_type: So it does take preference into account, strongly favouring requires and prefers tags, ignoring accept tags and heavily penalizing reject tags.
|
|
If one tool matches to two destinations and both qualify as candidate destinations, but the tool has tag that destination 1 requires but destination 2 accepts, destination 1 will always outrank destination 2 under the score function. The tool can run at both destinations and the prefer tag has never been used. My opinion is that without a prefer tag there is no reason for tags to come into ranking after candidate_destinations have been determined. We stopped using it on Galaxy Australia because of this side effect. |
|
For example, there was a tool and two destinations where it could run. There was no reason for one destination to be chosen over the other, but while we were using the score function destination 1 was always chosen. Tool tags: Destination 1 tags: Destination 2 tags: |
|
I think you make a good point about no longer counting required or reject tags after candidate destinations are matched. If we just set their respective scores to zero, wouldn't it have the same effect? In fact, it would also privilege the case where there are two matching prefers tags, as opposed to the ranking always being 1 or 0. |
|
Thanks @nuwang, that would solve my issue. I'll swap this change for what you have suggested. Having a higher weight for tool prefers dest and dest prefers tool makes sense. |
The score function counts all tags even if no PREFER tag is present and there is no reason to rank one destination higher than another.
I'd like to replace the score function with one that distinguishes only between pairs entities that prefer one another's tags and pairs that have no expressed preference for each other's tags.
@nuwang, I could keep this PR as is or add is_preferred(self, other) as a separate function returning a boolean.
I need to add a test to this.