Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Install JupyterLab instead of Jupyter #1479

Open
ndmlny-qs opened this issue Jun 8, 2022 · 1 comment
Open

Install JupyterLab instead of Jupyter #1479

ndmlny-qs opened this issue Jun 8, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ndmlny-qs
Copy link
Contributor

Issue Description

In setup.py we install jupyter, however, if a user uses Jupyter and runs a tutorial, then they might see improper rendering of math. See the images from the Hidden Markov tutorial below as an example.

Correct math rendering on the website.
correct-rendering-website

Incorrect rendering in Jupyter.
incorrect-rendering-jupyter

This can be fixed by switching out a Jupyter installation with a JupyerLab installation and adding the jupyerlab-katex plugin as a dependency.

Fixed rendering in Jupyter.
correct-rendering-jupyter

Steps to Reproduce

Use the instructions in the README.md and ensure you install Bean Machine using the pip install -e ".[dev]" command. If you do not install the dev environment, then you will not get a working Jupyter installation.

Expected Behavior

Tutorials would work the same way as on the website.

Additional Context

If we are going to suggest a user use conda, then we should have conda install pip as a dependency as well.

@ndmlny-qs ndmlny-qs added the enhancement New feature or request label Jun 8, 2022
@ndmlny-qs ndmlny-qs self-assigned this Jun 8, 2022
ndmlny-qs added a commit that referenced this issue Jun 8, 2022
### Motivation

Installs JupyterLab and a plugin `jupyterlab-katex` in order to render
math in the same way it is rendered on the website.

Resolves #1479

### Changes proposed

- Updates `setup.py` by switching out the `jupyter` install for
  `jupyterlab` and adds the `jupyterlab-katex` plugin.
- The `README.md` was also updated to fix a broken link to the tutorials
  section on the website.

### Test Plan

1. Followed the instructions on how to install Bean Machine using `pip
   install -e ".[dev]"` and a `conda` environment with the proposed
   changes.
1. Visually inspected in the Hidden Markov tutorial that math was being
   rendered correctly using the KaTeX plugin.

### Types of changes
- [x] Docs change / refactoring / dependency upgrade
- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

### Checklist
- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have read the **[CONTRIBUTING](https://github.com/facebookresearch/beanmachine/blob/main/CONTRIBUTING.md)** document.
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
- [x] The title of my pull request is a short description of the requested changes.
@ndmlny-qs
Copy link
Contributor Author

@feynmanliang and @horizon-blue The change is mostly for user experience when trying out Bean Machine and the tutorials on their local machine. If the switch from Jupyter notebook to JupyterLab is not something y'all want internally then I'm happy to remove the changes from setup.py, see the https://github.com/facebookresearch/beanmachine/tree/issue1479/jupyterlab-install branch for the proposed changes.

The change does have the side effect of incrementally moving the widget proposal into a usable state as the tools were designed for JupyterLab and not the plain Jupyter notebook session; https://github.com/facebookresearch/beanmachine/tree/ot-visual-widget-proposal. I don't think there is a difference in the behavior of the Bokeh tools in JupyterLab vs JupyterNB, but I have not tested them in both environments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant