simphony / simphony-osp

A framework that aims to achieve interoperability between software such as simulation engines, databases and data repositories using a knowledge graph as the common language.
https://simphony.readthedocs.io
Other
16 stars 12 forks source link

Enable use of pico as a module #761

Closed kysrpex closed 2 years ago

kysrpex commented 2 years ago

Closes #660.

The feature is available via the functions below.

from osp.core.pico import install, namespaces, packages, uninstall
Ktoti commented 2 years ago

Closes #660.

The feature is available via the functions below.

from osp.core.pico import install, namespaces, packages, uninstall

I get this error while trying to import install in jupyter notebook in DSMS : ImportError: cannot import name 'install' from 'osp.core.pico' . Does the class have dependencies?

kysrpex commented 2 years ago

Closes #660. The feature is available via the functions below.

from osp.core.pico import install, namespaces, packages, uninstall

I get this error while trying to import install in jupyter notebook in DSMS : ImportError: cannot import name 'install' from 'osp.core.pico' . Does the class have dependencies?

Please, double-check that you have installed a version of OSP-core that includes these changes. Remember that the target of this pull request is the branch called dev rather than master. This means that the change is not immediately published to master, neither to PyPI or GitHub's releases section .

Having said that, I will answer your questions from this message.

and why do we need more than just 1 path?

You do not need more than just 1 path. You can use either 1 path install("/home/me/emmo-mechanical-testing.yml") or more install("/home/me/emmo-mechanical-testing.yml", "/home/me/another-ontology.yml", "/home/me/third-ontology.yml"). This is just like using pico install from the command line.

is the path passed the yml file path?

Yes

Also:

In addition, I am adding this to the documentation, as @yoavnash suggested. Would you like to do the review of this addition? I think it makes sense since I thought @yoavnash was the one that needed this feature but it turns out that it is you, so nobody else will know better what is adequate.

Ktoti commented 2 years ago
osp.core.pico

How can I check if the version I have is the right one and which one it is?

yoavnash commented 2 years ago

pip freeze - google is your friend :)

kysrpex commented 2 years ago

pip freeze - google is your friend :)

I am afraid this will not help because the dev version of OSP-core has the same version number as the master version, plus here we are speaking of the commit level.

kysrpex commented 2 years ago
osp.core.pico

How can I check if the version I have is the right one and which one it is?

Find out where Python is importing the package from. Example on my computer (on your computer the path may be different).

In [1]: import osp.core; print(osp.core.__path__)
['~/.local/lib/python3.10/site-packages/osp/core']

Then open ~/.local/lib/python3.10/site-packages/osp/core/pico.py and compare it with the file on this PR. If there is any difference then you did not install a version with these changes.

kysrpex commented 2 years ago

@Ktoti Documentation for this is now available here. Please note that it is still not on the main branch, and be ready to press CTRL+F5 on your web-browser if you do not see the section I am linking.