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

Add autocompletion for namespaces (IPython only) #599

Closed kysrpex closed 3 years ago

kysrpex commented 3 years ago

This pull request aims to solve issue #591, at least for IPython users. The idea is to modify the __dir__ method of namespaces to include their ontology entities, so that auto completion is offered. A similar thing could maybe be done for the namespaces.py files, I still have to do more research on this.

To Do list to complete the pull request

kysrpex commented 3 years ago

Updated the checklist (added autocompletion for namespaces).

kysrpex commented 3 years ago

Updated the checklist (added autocompletion for namespaces). This will only work if the user first imports the namespaces module, i.e. import osp.core.namespaces as namespaces. Then autocompletion will be available for the namespaces object. I think it is not possible to autocomplete the statement from osp.core.namespaces import <...>.