Skip to content

๐Ÿ““ CLARISSA Tutorials

Interactive Jupyter notebooks that teach you how to build conversational interfaces for reservoir simulation.


๐Ÿš€ Choose Your Environment

Full development environment with PostgreSQL, OPM Flow, and all dependencies pre-configured.

Open in Gitpod

Option B: Google Colab (Best for GPU Training)

One-click access via the Colab badges in the tables below. Free GPU access (T4/A100).

First-Time Setup (Private Repo)

Since CLARISSA is a private repository, you need to connect your GitHub account to Colab once:

  1. Click any Colab badge below
  2. Colab will ask you to authorize GitHub access
  3. Log in with your GitHub account (wolfram-laube org access required)
  4. Done! Future clicks will open notebooks directly.

Colab Limitations

Colab doesn't have PostgreSQL or OPM Flow installed. The notebooks use SQLite fallback for vector storage and a mock simulator for demos. For production work, use GitPod or local setup.

Option C: Local Setup (Your Own Machine)

Run the notebooks on your laptop or workstation with full control.

Prerequisites

  • Python 3.10+
  • pip or conda
  • Git
  • (Optional) Docker for OPM Flow

Quick Start

# 1. Clone the repository
git clone https://gitlab.com/wolfram_laube/blauweiss_llc/clarissa.git
cd clarissa

# 2. Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# .venv\Scriptsctivate   # Windows

# 3. Install dependencies
pip install -r docs/tutorials/requirements.txt

# 4. Launch Jupyter
cd docs/tutorials
jupyter lab

Full Local Setup (with OPM Flow)

For running actual simulations locally:

# Install OPM Flow via Docker
docker pull opmproject/opm-simulators

# Or on Ubuntu/Debian:
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:opm/ppa
sudo apt-get update
sudo apt-get install mpi-default-bin libopm-simulators-bin

# Verify installation
flow --version

Git Workflow (Contributing Changes)

The CLARISSA repository is bidirectionally synchronized between GitLab and GitHub. You can work from either platform.

Two Repositories, Fully Synced

Repository URL Use Case
GitLab (primary) gitlab.com/wolfram_laube/blauweiss_llc/clarissa CI/CD, MRs, main development
GitHub (mirror) github.com/wolfram-laube/clarissa Colab notebooks, external collaboration

Both repos stay in sync automatically. Push to whichever you cloned from.

Step 1: Clone the Repository

# Option A: Clone from GitLab
git clone https://gitlab.com/wolfram_laube/blauweiss_llc/clarissa.git
cd clarissa

# Option B: Clone from GitHub (for Colab users)
git clone https://github.com/wolfram-laube/clarissa.git
cd clarissa

Step 2: Create a Feature Branch

Never commit directly to main

Always use feature branches. Direct commits to main bypass code review and can cause sync conflicts.

# Create and switch to a feature branch
git checkout -b feature/my-improvement

# Make your changes...
# Edit files, run tests, etc.

Step 3: Commit and Push

# Stage and commit your changes
git add .
git commit -m "feat: add waterflood example to tutorial 03"

# Push your feature branch
git push origin feature/my-improvement

Step 4: Create a Merge Request

If you pushed to... Create MR/PR on... Link
GitLab GitLab Create MR
GitHub GitLab (preferred) or GitHub GitLab MR

GitLab for Code Review

Even if you work on GitHub, create the Merge Request on GitLab where CI/CD pipelines run. Your GitHub branch will be synced to GitLab automatically.

Repository Sync Architecture:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     Bidirectional Sync                          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                 โ”‚
โ”‚   GitLab                              GitHub                    โ”‚
โ”‚   โ•โ•โ•โ•โ•โ•                              โ•โ•โ•โ•โ•โ•                    โ”‚
โ”‚   wolfram_laube/                      wolfram-laube/            โ”‚
โ”‚   blauweiss_llc/clarissa                 clarissa                  โ”‚
โ”‚                                                                 โ”‚
โ”‚        โ”‚                                   โ”‚                    โ”‚
โ”‚        โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Push Mirror โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚                    โ”‚
โ”‚        โ”‚           (immediate)             โ”‚                    โ”‚
โ”‚        โ”‚                                   โ”‚                    โ”‚
โ”‚        โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บ GitHub Actions โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚                    โ”‚
โ”‚        โ”‚           (~30 seconds)           โ”‚                    โ”‚
โ”‚        โ”‚                                   โ”‚                    โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”                        โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”               โ”‚
โ”‚   โ”‚  main   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  main   โ”‚               โ”‚
โ”‚   โ”‚feature/*โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚feature/*โ”‚               โ”‚
โ”‚   โ”‚  tags   โ”‚โ—„โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–บโ”‚  tags   โ”‚               โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ”‚
โ”‚                                                                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

For Colab Users (Saving Notebooks):

When you edit a notebook in Colab and want to save changes:

  1. File โ†’ Save a copy in GitHub
  2. Select repository: wolfram-laube/clarissa
  3. Create a new branch (e.g., colab/tutorial-03-update)
  4. Add a commit message
  5. Click "OK"

Your branch will automatically sync to GitLab. Then create an MR on GitLab for review.

Avoid Merge Conflicts

Don't edit the same file on both GitLab and GitHub simultaneously. The sync takes 30-60 seconds. If two people push conflicting changes within that window, manual conflict resolution is required.

Best Practice: Communicate with the team before editing shared files, or work on separate feature branches.

Dependencies Overview

The requirements.txt includes:

Package Purpose
numpy, pandas Data handling
matplotlib, seaborn Visualization
sentence-transformers Embeddings for RAG
openai, anthropic LLM APIs (optional)
langchain LLM orchestration
z3-solver Constraint engine
fastapi, httpx API framework

API Keys

For notebooks using LLM APIs, set your keys:

export OPENAI_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-ant-..."


๐Ÿ“š Learning Path

Beginner (Notebooks 01-03)

Notebook Description Duration Colab
01 ECLIPSE Fundamentals Deck structure, keywords, parsers ~45 min Colab
02 OPM Flow Integration Docker, simulation runner, results ~30 min Colab
03 Knowledge Layer pgvector, RAG, analog database ~45 min Colab

After completing: You can parse ECLIPSE decks, run simulations, and query a knowledge base.

Intermediate (Notebooks 04-06)

Notebook Description Duration Colab
04 LLM Conversation Slot extraction, prompts, state ~60 min Colab
05 Constraint Engine Z3, physics validation ~45 min Colab
06 Deck Generator Template engine, assembly ~45 min Colab

After completing: You can build conversational deck generation with physics validation.

Advanced (Notebooks 07-10)

Notebook Description Duration Colab
07 RL Agent PPO, reward shaping ~90 min Colab
08 RIGOR Benchmark Test framework, scoring ~60 min Colab
09 Full Pipeline Demo End-to-end showcase ~30 min Colab
10 API Reference FastAPI endpoints ~30 min Colab

After completing: You understand the complete CLARISSA system and can extend it.


๐ŸŽฎ Interactive Playgrounds

Notebook Description Duration Colab
11 CRUD Playground CLARISSA API testing ~20 min Colab
12 GitLab API Playground Issues, MRs, Pipelines ~25 min Colab
13 OPM Flow Playground Deck files, Simulation ~30 min Colab
14 Infrastructure Playground Runners, Sync, Metrics ~20 min Colab

No prior experience required! These playgrounds let you explore CLARISSA interactively:

  • 11 CRUD: Test the CLARISSA conversation API
  • 12 GitLab: Manage issues, merge requests, pipelines
  • 13 OPM Flow: Create and run reservoir simulations
  • 14 Infrastructure: Monitor runners, sync status, metrics

๐ŸŽค Showcases

Notebook Description Duration Colab
15 OPM Flow Showcase 3D Visualization, GIF Export ~25 min Colab
16 Voice Input Showcase ๐ŸŽค Speech-to-Simulation ~30 min Colab

๐ŸŽค Voice Input - Talk to Your Simulation!

The Voice Input Showcase demonstrates CLARISSA's conversational interface:

  • Speech-to-Text with OpenAI Whisper
  • Intent Recognition for reservoir engineering commands
  • Visualization Execution triggered by voice

Try saying: "Show me the permeability" or "What's the water cut?"

More resources:


๐Ÿ› ๏ธ Environment Comparison

Feature GitPod Colab Local
PostgreSQL + pgvector โœ… Native โš ๏ธ SQLite โœ… Install required
OPM Flow โœ… Docker โš ๏ธ Mock โœ… Docker/native
GPU โŒ โœ… T4/A100 โš ๏ธ If available
Persistent files โœ… Git โš ๏ธ Google Drive โœ… Local disk
Direct notebook links โœ… โœ… โœ…
Setup time ~2 min ~1 min ~15 min

Recommendation:

  • Development: Use GitPod (full features, zero setup)
  • GPU Training: Use Colab (free GPU access)
  • Offline Work: Use local setup (full control)

๐Ÿ“– Prerequisites

  • Basic Python knowledge
  • Familiarity with Jupyter notebooks
  • (Optional) Reservoir engineering fundamentals

No prior ECLIPSE or simulation experience required - we'll teach you!



โ“ Troubleshooting

"Module not found" errors

pip install -r requirements.txt --upgrade

OPM Flow not working locally

# Check if Docker is running
docker ps

# Pull latest image
docker pull opmproject/opm-simulators

# Test
docker run --rm opmproject/opm-simulators flow --help

Colab session disconnects

Save your work frequently. Use Google Drive mount for persistence:

from google.colab import drive
drive.mount('/content/drive')

๐ŸŽฌ Complete Showcases

Notebook Description Duration Colab
15 OPM Flow Showcase End-to-end workflow: Install โ†’ Build โ†’ Simulate โ†’ Analyze ~15 min Colab

Featured Demo: Build a 5-spot waterflood model, run OPM Flow simulation, analyze production curves, and perform sensitivity analysis - all in one notebook!