Skip to content

Commit

Permalink
activity prep
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwoods2 committed Nov 21, 2024
1 parent eba7aff commit 8622c3c
Show file tree
Hide file tree
Showing 19 changed files with 281 additions and 323 deletions.
Binary file removed .media/browser.png
Binary file not shown.
Binary file added .media/browser_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .media/browser_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .media/ide.png
Binary file not shown.
Binary file added .media/ide_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .media/ide_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .media/ide_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 69 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,85 @@
# IMD Workshop 2024

## Getting a codespace
Welcome to the interactive portion of the workshop!
To get started, we recommend using VSCode
in the browser with the Github codespace we've provided
which includes all the tools you'll need to get started with live
simulation streaming.

To get access to the workshop environment, you have two options:
# 1. Codespace environment setup

### 1. In the browser
## i. Github codespaces in the browser (recommend)

The easiest way is to simply click the "+" in the codespaces menu in this repo (shown below) to create a new codespace. A workshop environment will be created and VSCode will automatically run in your browser
with the extensions and packages you'll need already installed, including GROMACS, LAMMPS, NAMD, MDAnalysis, and IMDClient.
The easiest way is to simply use this repository to create a codespace.
A workshop environment will be created and VSCode will automatically run in your browser.

![alt text](.media/browser.png)
### Step 1.

### 2. In your IDE
Select the "new with options" codespace button.

You can also use your own IDE to spin up and connect to a codespace. If you have VSCode installed, you can install the
![alt text](.media/browser_1.png)

### Step 2.

Select the region closest to you.

![alt text](.media/browser_2.png)

### Step 3.

Finally, select "Create codespace" to launch the codespace.

## ii. Github codespaces tunnel from your IDE (VSCode and Pycharm)

You can use your own IDE to spin up and connect to a codespace (which GitHub will host).

If you are using VSCode, follow these steps:

### Step 1.

If you have VSCode installed, you can install the
[codespace extension](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces).
After installing, you'll see the "remote explorer" icon on the left.
Click "Create Codespace" and type in "Becksteinlab/imd-workshop-2024" and select the "main" branch and a 2-core CPU.

![alt text](.media/ide.png)
### Step 2.

After installing, you'll see the "remote explorer" icon on the left. Click this and select "Github codespaces"
in the dropdown.

![alt text](.media/ide_1.png)
![alt text](.media/ide_1.png)

### Step 3.

Select the "+"

![alt text](.media/ide_3.png)

For the repository, enter "ljwoods2/imd-workshop-2024"
For the branch, select "main"
For the machine type, select "2 cores, 8GB RAM, 32 GB storage"

After that, VSCode will automatically launch a new window which is executing in the codespace workshop environment.
To troubleshoot, see the documentation [here](https://docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-in-visual-studio-code).

An extension is also available [for Pycharm](https://plugins.jetbrains.com/plugin/20060-github-codespaces).
### Pycharm

A codespace extension is also available for [Pycharm](https://plugins.jetbrains.com/plugin/20060-github-codespaces).

## Setting up the activity notebook
## iii. Local codespace in IDE (VSCode only) (slow, not recommend)

You can also run the workshop activity locally if you have the [devcontainers VScode extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
and [docker](https://docs.docker.com/engine/install/) installed.

After docker is installed & enabled and your user has been added to the docker group, run:
```bash
git clone https://github.com/ljwoods2/imd-workshop-2024.git
code imd-workshop-2024
```
In VSCode, enter CTRL+SHIFT+P and type: "Dev Containers: Open Folder in Container..." and select
the root of the cloned repo as the folder path. A new window will open which is executing
in the workshop activity codespace.

# 2. Getting started with the activity

First, open the "activity/activity.ipynb" jupyter notebook from this repo in your codespace environment.

Expand All @@ -34,5 +88,5 @@ in the upper right corner of the jupyter notebook. You may have to restart the k

After that, follow the instruction in the notebook to run the simulation engines and your analysis code!



![alt text](.media/codespace_1.png)
![alt text](.media/codespace_2.png)
184 changes: 182 additions & 2 deletions activity/activity.ipynb

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions activity/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

mkdir -p sample_simulation
cd sample_simulation
# if [ ! -f sample_simulation/topol.tpr ]; then
# echo "Running grompp"
# gmx grompp -f imd.mdp -c start.gro -p topol.top -o >& grompp.out
# fi
echo "Starting mdrun"
# modify gromacs execution string according to available resources
# here we use 2 parallel threads
gmx mdrun -v -nt 2 -imdwait -imdport 8889
cd ..
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ IMD-time = yes
IMD-box = yes
IMD-coords = yes
IMD-unwrap = yes
IMD-forces = no
IMD-vels = no
IMD-forces = yes
IMD-vels = yes
IMD-energies = no
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions activity/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import matplotlib.pyplot as plt
from IPython.display import display, clear_output


def start_interactive_display():
plt.ion() # Turn on interactive mode


def stop_interactive_display():
plt.ioff()


def update_display(obj):
clear_output(wait=True)
display(obj)
178 changes: 0 additions & 178 deletions gromacs-demos/distances/demo.ipynb

This file was deleted.

49 changes: 0 additions & 49 deletions gromacs-demos/distances/demo.py

This file was deleted.

55 changes: 0 additions & 55 deletions gromacs-demos/distances/dynplot.py

This file was deleted.

Binary file removed gromacs-demos/distances/mda.tpr
Binary file not shown.
22 changes: 0 additions & 22 deletions gromacs-demos/distances/run.sh

This file was deleted.

0 comments on commit 8622c3c

Please sign in to comment.