Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,17 @@ test/input_files/**/*.json
!test_LinearThermal.json
!test_PseudoPlastic.json
!test_J2Plasticity.json

# AiiDA-FANS tutorial required files
!tutorial_dataset.h5

# AiiDA-FANS tutorial generated files
configure_profile.yaml
configure_computer.yaml
configure_code.yaml
.aiida_run

# pixi
.pixi
pixi.lock
*.egg-info
59 changes: 59 additions & 0 deletions AiiDA-FANS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# aiida-fans-tutorial

Check failure on line 1 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "# aiida-fans-tutorial"]
Learn how to use aiida-fans in this marimo powered tutorial.

## Usage

Assuming you have FANS, python 3.13, venv, and pip installed on a linux system, the recommended way to use this tutorial is by creating a virtual environment in this directory with the following command:

```

Check failure on line 8 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
python -m venv .venv
```

Check failure on line 10 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should be surrounded by blank lines [Context: "```"]
Then activate this environment like so:

```

Check failure on line 13 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
source .venv/bin/activate
```

You can ensure the the environment was succesfully activated with `which python` and ultimately deactivate the environment with `deactivate` when you're finished.

You may need to install/upgrade pip now with your virtual environment activated. Run the following command:

```

Check failure on line 21 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
python -m pip install --upgrade pip
```

Once pip is up to date, run the following command to install the tutorial's dependencies:

```

Check failure on line 27 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
python -m pip install -r requirements.txt
```

Now you are ready to launch the notebook and begin the tutorial. Run the following command and access the marimo notebook at the port provided:

```

Check failure on line 33 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
marimo run tutorial.py
```

## Alternative Usage

### 1. Conda

> [!WARNING]
> This method is a work-in-progress!

### 2. Pixi

> [!WARNING]
> This method is a work-in-progress!

You can use pixi to install everything you need as defined by the pyproject.toml file. It should bundle python, FANS, AiiDA, aiida-fans, and marimo all into a virtual environment located in a .pixi directory. You can proceed to directly begin the tutorial with:

```

Check failure on line 51 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
marimo run tutorial.py
```

Activating the environment may look something like this:

```

Check failure on line 57 in AiiDA-FANS/README.md

View workflow job for this annotation

GitHub Actions / Lint markdown files

Fenced code blocks should have a language specified [Context: "```"]
pixi shell --manifest-path ~/FANS/tutorial/pyproject.toml
```
21 changes: 21 additions & 0 deletions AiiDA-FANS/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[project]
name = "aiida-fans-tutorial"
description = "Learn how to use aiida-fans in this marimo powered tutorial."
authors = [{name = "Ethan Shanahan", email = "ethan.shanahan@gmail.com"}]
requires-python = ">= 3.12"
version = "0.1.0"
dependencies = []

[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.12.10,<4"
marimo = ">=0.13.0,<0.14"
aiida-fans = ">=0.1.5,<0.2"
fans = ">=0.3.0,<0.4"
2 changes: 2 additions & 0 deletions AiiDA-FANS/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
aiida-fans==0.1.5
marimo==0.13
Loading
Loading