SynBioDex / tyto

Use ontology terms in your Python application
Apache License 2.0
19 stars 3 forks source link

Offline mode #38

Open jakebeal opened 3 years ago

jakebeal commented 3 years ago

Can we give tyto the ability to run offline when somebody is not connected to the internet?

bbartley commented 3 years ago

While there isn't currently an elegant way to toggle between offline/online work, you can force tyto to use a local copy of the ontology when one is available by unsetting the endpoints attribute.

tyto.SO.endpoints = []

When no endpoints are available, tyto will fall back to loading a local copy of the ontology if one is available. Currently, ontology files are distributed with tyto for a few of the ontologies (SO, SBO, OM) supporting offline work, but some are not (NCIT is too large for distribution).

jakebeal commented 3 years ago

I think you may want to add a test for this, as it crashed on me looking for an SBO term while working offline this morning.