Skip to content
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

Add autocompletion for namespaces (IPython only) #599

Merged
merged 4 commits into from
May 27, 2021

Conversation

kysrpex
Copy link
Contributor

@kysrpex kysrpex commented Mar 23, 2021

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

  • Add autocompletion for Ontology Entities inside a namespace.
  • Add autocompletion of namespaces (when writing osp.core.namespaces.[...]).
  • Write unit tests for both cases.

@kysrpex
Copy link
Contributor Author

kysrpex commented Mar 23, 2021

Updated the checklist (added autocompletion for namespaces).

@kysrpex kysrpex self-assigned this Mar 23, 2021
@kysrpex kysrpex added 📜 ontology 🔨 simple fix Likely to be solvable in at most a few hours (full-time). labels Mar 23, 2021
@kysrpex kysrpex linked an issue Mar 23, 2021 that may be closed by this pull request
5 tasks
@kysrpex kysrpex requested review from pablo-de-andres and removed request for pablo-de-andres March 23, 2021 13:21
@kysrpex kysrpex changed the title Add autocompletion for namespaces. Add autocompletion for namespaces (IPython only) Mar 24, 2021
@kysrpex
Copy link
Contributor Author

kysrpex commented Mar 24, 2021

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 <...>.

@kysrpex kysrpex marked this pull request as ready for review May 25, 2021 09:11
tests/test_namespace.py Outdated Show resolved Hide resolved
osp/core/ontology/namespace.py Outdated Show resolved Hide resolved
osp/core/ontology/namespace.py Show resolved Hide resolved
osp/core/ontology/namespace.py Show resolved Hide resolved
@kysrpex kysrpex merged commit 89162e4 into dev May 27, 2021
@kysrpex kysrpex deleted the 591-Support_IntelliSense_with_ontology_information branch May 27, 2021 13:29
@kysrpex kysrpex added this to the Sprint #3 milestone May 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 simple fix Likely to be solvable in at most a few hours (full-time). 📜 ontology
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support IntelliSense with ontology information
2 participants