biolink / biolink-model-toolkit

A collection of useful python functions for looking up information and working with the Biolink Model
https://biolink.github.io/biolink-model-toolkit/
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

Biolink latest version giving bmt errors #88

Closed YaphetKG closed 1 year ago

YaphetKG commented 1 year ago

I recently did this

!pip install bmt==0.8.11
from bmt import Toolkit
import bmt
url = 'https://raw.githubusercontent.com/biolink/biolink-model/v3.0.1/biolink-model.yaml'
bmt = Toolkit(url)

on a jupyter notebook , but it seems like there is a value error that is raised

~\Anaconda3\lib\site-packages\linkml_runtime\utils\yamlutils.py in __post_init__(self, *args, **kwargs)
     46                 v = repr(kwargs[k])[:40].replace('\n', '\\n')
     47                 messages.append(f"{TypedNode.yaml_loc(k)} Unknown argument: {k} = {v}")
---> 48             raise ValueError('\n'.join(messages))
     49 
     50     def _default(self, obj, filtr: Callable[[dict], dict] = None):

ValueError:  Unknown argument: reachable_from = {'source_ontology': 'bioregistry:uberon'
sierra-moxon commented 1 year ago

Hi @YaphetKG :)

Thank you for testing this out and submitting a ticket. That error comes when the version of linkml-runtime and linkml dependencies are out of date. I think jupyter-notebook inherits your virtual environment cache and also uses your local virtual environment. Can you do a !pip list in the notebook and check what versions your linkml dependencies are on?

If I do this:

!pip install --no-cache-dir bmt==0.8.11
from bmt import Toolkit
import bmt
url = 'https://raw.githubusercontent.com/biolink/biolink-model/v3.0.1/biolink-model.yaml'
bmt = Toolkit(URL)
!pip list

I get:

linkml                        1.3.2
linkml-dataops                0.1.0
linkml-runtime                1.3.2

The reachable_from syntax is new to linkml 1.3.2, and we use it in biolink to constrain enumerations.

YaphetKG commented 1 year ago

ah ok , let me try it thanks @sierra-moxon

YaphetKG commented 1 year ago

It is working thanks for the hint @sierra-moxon

gaurav commented 1 year ago

Is there any way to ensure that bmt > 0.8.8 always requires linkml > 1.3.2? I just ran into this problem because I upgraded to bmt 0.8.11 but my linkml is still at 1.2.10. My Python package config skills are weak, but I think you can add it to requirements.txt.