-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[23.0] Fix parsing tool metadata from bio.tools #16449
Conversation
The keys "topic" and "function" do not exist any longer for many tools. Thus, such tools fail to load.
…o.tools metadata Co-authored-by: Nicola Soranzo <[email protected]>
Closing due to this comment. |
23.0 is probably the right one, we don't normally support releases older than a year, see https://github.com/galaxyproject/galaxy/blob/dev/SECURITY.md#supported-versions . |
Sorry, then I will reopen again 😅. |
Just a stylistic issue, but shouldn't from_json be a classmethod rather than a staticmethod? |
That's true, it would make better sense for it to be a class method (devs: feel free to commit changes). |
No, classmethods have the special |
@kysrpex Can you have a look at this comment #16447 (comment) please? |
Why would a class method be incorrect, if referencing the class itself is precisely what line 22 is doing? Class |
At the moment I am just as aware as you are. We enabled the feature and it did not work due to those keys being missing. If I learn why the keys were removed then I let you know. |
bio.tools entries do not NEED to contain EDAM terms. This is known, not good, but we need to live with this or annotate them. |
and are they actively being removed, or do you see the errors for tools that didn't have any biotools entry previously ? |
The thing is that we had this feature disabled, right @bgruening? So we did not have the chance to see errors until now. Please correct me if I am wrong because I am not 100% sure of what I am saying. |
I try to summarize what I have seen so far.
|
It's not about referencing the class, it's about not having |
@nsoranzo not that it makes a big difference here, but my point was precisely that the current staticmethod returns an instance of a hard-coded type (BiotoolsEntry), when it could use the cls argument available in a classmethod, just like it's done in many places of the stdlib (e.g. https://github.com/python/cpython/blob/8725d36fda2125fd089e6a714ba70089ba7498db/Lib/collections/__init__.py#L295) to implement "alternative constructors". |
@nsoranzo In the link that you have provided, you can find this example: # Python program to demonstrate
# use of class method and static method.
from datetime import date
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
# a class method to create a Person object by birth year.
@classmethod
def fromBirthYear(cls, name, year):
return cls(name, date.today().year - year)
# a static method to check if a Person is adult or not.
@staticmethod
def isAdult(age):
return age > 18
person1 = Person('mayank', 21)
person2 = Person.fromBirthYear('mayank', 1996)
print(person1.age)
print(person2.age)
# print the result
print(Person.isAdult(22)) I see the method |
The example from the standard library is also pretty good. |
that's not right, at least for the current setup where we write release notes once ... do we need to adjust the target milestone on older branches as well? PRs against dev are milestoned correctly |
Let's keep the refactoring for dev. Thanks for the fix! |
Galaxy issue #16445. Related, closed PRs: #16447, #16448, #16450.
Parsing bio.tools data for tool metadata is broken,
probably because of research-software-ecosystem/content#fd9ed50 or research-software-ecosystem/content#7b40d92(sorry, we are using this feature on usegalaxy.eu just since last night). The keys "function" and "topic" do not exist any longer for many tools. Thus, such tools fail to load.https://sentry.galaxyproject.org/organizations/galaxy/issues/123152/events/291df96a5e694baa978051863bb16e51/
How to test the changes?
(Select all options that apply)
We know this works from fixing it in production on usegalaxy.eu after noticing that many of our tools disappeared, but proper test coverage would be needed. I am leaving the test coverage to you.
License