This repo contains a python script and also a jupyter notebook that creates a Interactive Plot Selector HTML page for DANDI dataset.
Setting Up a Python Virtual Environment with a Hidden .venv
Directory
-
Python 3.x: Ensure Python is installed in your environment.
- Check your Python version:
python3 --version
- If Python is not installed, install it:
sudo apt update sudo apt install python3 python3-venv python3-pip
- Check your Python version:
-
Virtual environment module: The
venv
module is typically included with Python 3.x. If not, install it using:
sudo apt install python3-venv
-
Navigate to this git-repo directory in your terminal.
-
Create a virtual environment named
.venv
to keep it hidden:
python3 -m venv .venv
- Activate the virtual environment in terminal:
source .venv/bin/activate
After activation, the terminal prompt will indicate the active environment, typically by showing
(venv)
.
- To deactivate the virtual environment, run:
deactivate
To install the dependencies (which will be isolated in this environment) after activating the virtual environment, run:
pip install -r requirements.txt
The main purpose of the Python Script is to create the DANDI_interactive_plot_selector.html
, an interactive plot selector HTML page. The Jupyter Notebook is primarily used for testing purposes
After activating the virtual environment, run:
python3 dashboard.py
- Upon complition you will see this message:
HTML file generated as 'DANDI_interactive_plot_selector.html'
DANDI_interactive_plot_selector.html
is the webpage containing the interactive plots.
Note: Along with the
DANDI_interactive_plot_selector.html
file,dashboard.py
also creates a./plots
folder, which contains all the interactive plots for the subjects as well as the Modality X Subject plot, which are used by theDANDI_interactive_plot_selector.html
file.
-
Open the
dashboard.ipynb
jupyter notebook either in you IDE (e.g., VS Code) or via jupyter notebook environment interface (in you terminal run:jupyter notebook
) and selectdashboard.ipynb
in the web interface. -
Select the Kernel
.venv (Python {version})
using theSelect Kernel
option. -
Run the cells, play around and enjoy!
Note: The
dashboard.ipynb
creates an additional folder./objs
along withDANDI_interactive_plot_selector.html
and./plots
. The./objs
folder contains pickle objects as checkpoint files, this allows users to avoid reloading or filtering the data repeatedly when testing during later stages of the notebook.