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

[joss] HyperNetX Widget not working #143

Closed
szhorvat opened this issue Jan 19, 2024 · 11 comments
Closed

[joss] HyperNetX Widget not working #143

szhorvat opened this issue Jan 19, 2024 · 11 comments
Assignees
Labels
active Work in progress joss

Comments

@szhorvat
Copy link
Contributor

The HyperNetX Widget is prominently mentioned in both the documentation and the JOSS paper. https://hypernetx.readthedocs.io/en/latest/widget.html Unfortunately I wasn't able to get it working. Can you help with this?

The paper states that the widget works in Jupyter notebooks. After evaluating the first cell from the demo notebook, I see the following output only:

image

No interactive widget appears.

I am using:

  • Jupyter Lab 4.0.8
  • HNX 2.1.3 and hnxwdget 0.1.1b3 (both from PyPI)
  • Python 3.11

The documentation goes into great detail on how to operate the graphical interface provided by the widget, but it is silent on how to make the widget appear and what code to run to create the widget (i.e. the prerequisites to enabling the described GUI). This should be remedied. https://hypernetx.readthedocs.io/en/latest/widget.html

Ref: openjournals/joss-reviews#6016

@szhorvat szhorvat changed the title [joss] HyperNetX Widget [joss] HyperNetX Widget not working Jan 19, 2024
@bonicim
Copy link
Collaborator

bonicim commented Jan 19, 2024

Taking a look.

@bonicim bonicim self-assigned this Jan 19, 2024
@szhorvat
Copy link
Contributor Author

It is entirely possible that something's wrong with my setup. Help with fixing this would be appreciated.

@bonicim bonicim added the active Work in progress label Jan 22, 2024
@bonicim
Copy link
Collaborator

bonicim commented Jan 22, 2024

I reproduced the issue using the same configuration. I have tried to use the widget on both Jupyter notebook and Jupyter lab. We are currently working on resolving this issue.

@bonicim bonicim added the joss label Jan 22, 2024
@bonicim
Copy link
Collaborator

bonicim commented Jan 23, 2024

@szhorvat After working with the team on this issue, it appears that hnxwidget will now only work on the Anaconda platform (i.e use a conda environment instead of a vanilla venv virtual environment). You are right that the documentation needs to be updated and I will start work on that. In the meanwhile, below are my notes on how to use the widget. Also attached is a screenshot of what to expect on Jupyter notebook.

----------Notes---------

How to run HNX widget

hnxwidget is currently in beta and will only work on Jupyter Notebook 6.5.x. It is currently not yet supported on Jupyter Lab. Moreover, hnxwidget is currently supported only on the Anaconda platform; therefore, it is highly recommended to use a conda environment to use this widget. Do not use python's builtin venv module or virtualenv.

Prerequisites

  • conda 23.11.x
  • python 3.11.x
  • jupyter notebook 6.5.4
  • ipywidgets 7.6.5

Instructions

Open a new shell and run the following commands.

# update conda
conda update conda

# activate the base environment
conda activate

# install hypernetx and hnxwidget
pip install hypernetx hnxwidget

# install jupyter notebook and extensions
conda install -y -c anaconda notebook
conda install -y -c conda-forge jupyter_contrib_nbextensions

# install and enable the hnxwidget on jupyter
jupyter nbextension install --py --symlink --sys-prefix hnxwidget
jupyter nbextension enable --py --sys-prefix hnxwidget

# install ipykernel and use it to add the base environment to jupyter notebook
conda install -y -c anaconda ipykernel
python -m ipykernel install --user --name=base

# start the notebook
# ensure that you set your kernel to `base` so that your notebook has the conda base environment as its environment
jupyter-notebook

Refs:
How to add your Conda environment to your jupyter notebook in just 4 steps | by Noopur R K | Medium

Screenshot 2024-01-23 at 15 11 28

@bonicim
Copy link
Collaborator

bonicim commented Feb 2, 2024

The HyperNetX widget is currently in beta with limitations on the Jupyter environment in which it may be used. It is being actively worked on. Look for improvements and an expanded list of usable environments in a future release.

In addition, updates to the documentation are currently in progress and are planned to be published in the next week or so.

@bonicim
Copy link
Collaborator

bonicim commented Feb 16, 2024

Resolved in release 2.14

@bonicim bonicim closed this as completed Feb 16, 2024
@szhorvat
Copy link
Contributor Author

Can you please clarify what you mean here?

It is highly recommended to use the base environment provided by Anaconda because Anaconda’s package management system, conda, will resolve dependencies when HyperNetX and HyperNetXWidget are installed.

Is it suggesting to install HNX and HNXWidget in the base environment instead of a dedicated environment? If so, why? My impression was that installing everything in the base environment was not considered good practice.

@szhorvat
Copy link
Contributor Author

Can you please clarify this?

@bonicim
Copy link
Collaborator

bonicim commented Feb 28, 2024

For users with inexperience with Jupyter and Anaconda, it is recommended to use the base environment of Anaconda so that the widget works seamlessly and out-of-the box on Jupyter Notebook (the widget does not work on Jupyter Lab). If users want to create a custom environment from base, then users will need to do additional configuration on Jupyter and the kernel to ensure that the widget works; a link to a blog post on how to set the Kernel to a custom environment has been included in the documentation.

I can modify the documentation to make this more clear.

@drj11
Copy link

drj11 commented Feb 29, 2024

I agree that installing everything in the base environment is not best practice, but it's still a very widely established practice. As long it's documented, i personally would not withhold a publication recommendation on that basis.

@bonicim
Copy link
Collaborator

bonicim commented Mar 2, 2024

Have updated the environment setup steps for the widget: https://hypernetx.readthedocs.io/en/latest/widget.html#installation

bonicim added a commit that referenced this issue Apr 1, 2024
Merge in HYP/hypernetx from HYP-396-add-cff-citation to develop

* commit '44e06fa63209feb9df4b573b6efd1e6a77e69358':
  HYP-396 Add CFF citation; add cff workflow and badge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
active Work in progress joss
Projects
None yet
Development

No branches or pull requests

3 participants