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

Documentation and class introspection #2

Open
christian-oreilly opened this issue Sep 30, 2022 · 0 comments
Open

Documentation and class introspection #2

christian-oreilly opened this issue Sep 30, 2022 · 0 comments
Assignees

Comments

@christian-oreilly
Copy link
Contributor

Thanks for putting this notebook integration together. It looks great and promising! I tried this tool using the use cases of visualizing 1) a NIfTI file I have and 2) EEG sources computed from MNE-Python. The widget displays as expected using

from ipyniivue import Niivue
w = Niivue()
w

However, I am afraid that is where my use cases hit a dead end. The first python-programmer reflex, I think, would be to check the docstring for the Niivue class. Checking it through the IPython ? operator:

Init signature: Niivue(*args, **kwargs)
Docstring:      Widget that can be inserted into the DOM
Init docstring: Public constructor
File:           ~/Library/CloudStorage/GoogleDrive-christian.oreilly@gmail.com/My Drive/Code/ipyniivue_ts/ipyniivue/widget.py
Type:           MetaHasTraits
Subclasses:     

This does not help me as there are no named arguments. I cannot introspect the bells and whistles available on this widget. The second reflex: going through the code on GitHub. Looking at it, it appears there is about no Python coding in the wrapper on this widget. It is an extremely thin wrapper, exposing no public methods and attributes. This means that I would need to dig into javascript or ts which, as a Python programmer (I suppose, the intended target), is a no-go.

Third reflex, running dir(Niivue) which lists the attributes and methods of the class. That is a bit more useful as it at least give me some methods to explore, but these do not seem to be methods specific to the functionalities of that specific widget... I could search my way in the dark and teach myself what is traitlets and how to use this framework, but the bottom line is that to attract a significant Python user base, I think this project will need to :

1 - Have a deeper richer wrapper, exposing useful methods and attributes for programmatic interaction in Python.
2 - Provide additional documentation to illustrate how most common operations (loading a file, panning, rotating, zooming, changing color map, etc.) can be performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants