Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0e81bb9
v1.0.0: code quality, tests, docs, and CI overhaul
Ajax23 Jun 29, 2026
751b691
v1.0.0: preserve old built docs under docs/v_old/
Ajax23 Jul 4, 2026
1b6cf0b
v1.0.0: bump Python floor to 3.12, update CI matrix and docs
Ajax23 Jul 4, 2026
c7f40e1
v1.0.0: migrate packaging to pyproject.toml (PEP 517/621)
Ajax23 Jul 4, 2026
111c898
v1.0.0: modernise CI toolchain and ruff config
Ajax23 Jul 4, 2026
1e942c1
v1.0.0: add dev optional-dependencies group
Ajax23 Jul 4, 2026
8992620
v1.0.0: update Testing section to use pip install -e ".[dev]"
Ajax23 Jul 4, 2026
b3b6995
v1.0.0: fix stale setup.py reference in changelog
Ajax23 Jul 4, 2026
e723004
fix: mutable defaults, super() modernization, and open() encoding
Ajax23 Jul 4, 2026
3522e4a
fix ruff lint and format violations
Ajax23 Jul 4, 2026
c292b64
fix lint CI: use uvx instead of uv pip install --system
Ajax23 Jul 4, 2026
5466349
fix CI: drop uv --system flag, use uv run for commands
Ajax23 Jul 4, 2026
5e6bc49
add workflow_dispatch trigger to CI
Ajax23 Jul 4, 2026
a51cab4
fix pyproject.toml: move classifiers to [project] section
Ajax23 Jul 4, 2026
aefd137
exclude templates from autoapi docs build
Ajax23 Jul 4, 2026
44fa944
modernize docs: drop v_old snapshot, add MyST/furo improvements
Ajax23 Jul 11, 2026
f11b808
docs: convert illustration PDFs to SVG, fix logo clipping
Ajax23 Jul 11, 2026
c2390df
docs: remove obsolete illustration PDF images replaced by SVG
Ajax23 Jul 11, 2026
c0f5f94
docs: add viewBox headroom to logo to prevent top clipping
Ajax23 Jul 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint

on:
push:
pull_request:

jobs:
ruff:
name: ruff
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Lint
run: uvx ruff check poresim/
- name: Format check
run: uvx ruff format --check poresim/
22 changes: 22 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Security

on:
push:
branches: [main]
schedule:
- cron: "0 6 * * 1" # every Monday at 06:00 UTC

jobs:
pip-audit:
name: pip-audit
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv pip install --system pip-audit .
- name: Audit dependencies
run: pip-audit
83 changes: 57 additions & 26 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,69 @@
name: Build Status
name: CI

on:
push:
branches:
- main
- 'feature/*'
branches: [main]
pull_request:
workflow_dispatch:

jobs:
build:

test-unit:
name: Unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.11,3.12,3.13]
python-version: ["3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv pip install ".[dev]"
- name: Run unit tests
run: uv run pytest tests/test_unit.py --cov=poresim -q
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: PoreMS/PoreSim

test-integration:
name: Integration tests
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install pytest-cov pytest
python -m pip install .
- name: Run tests
run: |
pytest --cov --cov-branch --cov-report=xml tests/
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: PoreMS/PoreSim
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv pip install pytest .
- name: Run integration tests
run: uv run pytest tests/test_integration.py -q

docs:
name: Build and deploy docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
python-version: "3.12"
- name: Install dependencies
run: uv pip install -r docs/requirements.txt .
- name: Build Sphinx docs
run: |
cd docs
uv run make html
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
publish_branch: gh-pages
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
poresim.egg-info
build
dist
__pycache__
*.pyc
.DS_Store
._.DS_Store
.ipynb_checkpoints
.coverage
.pytest_cache
.claude
venv
docs/_build
docs/autoapi/
docs/generated/
tests/output
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

41 changes: 25 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
<img src="https://github.com/PoreMS/PoreSim/blob/main/docsrc/pics/logo_text_sub.svg" width="60%">
<img src="https://github.com/PoreMS/PoreSim/blob/main/docs/pics/logo_text_sub.svg" width="60%">

--------------------------------------

[![PyPI Version](https://img.shields.io/badge/PyPI-0.3.0-orange)](https://pypi.org/project/PoreSim/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/PoreMS/PoreSim/blob/master/LICENSE)
[![PyPI Version](https://img.shields.io/badge/PyPI-1.0.0-orange)](https://pypi.org/project/poresim/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/PoreMS/PoreSim/blob/main/LICENSE)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17395962.svg)](https://doi.org/10.5281/zenodo.17395962)
[![Build Status](https://github.com/PoreMS/PoreSim/actions/workflows/workflow.yml/badge.svg)](https://github.com/PoreMS/PoreSim/actions/workflows/workflow.yml)
[![codecov](https://codecov.io/gh/PoreMS/PoreSim/branch/main/graph/badge.svg)](https://codecov.io/gh/PoreMS/PoreSim)

## Documentation

Online documentation is available at [PoreMS.github.io/PoreSim](http://PoreMS.github.io/PoreSim).
Online documentation is available at [porems.github.io/PoreSim](https://porems.github.io/PoreSim/).

The docs include an example for creating [simulation boxes](http://PoreMS.github.io/PoreSim/simulation.html), and an [API reference](http://PoreMS.github.io/PoreSim/api.html).
The docs include an example for creating [simulation boxes](https://porems.github.io/PoreSim/simulation.html) and an [API reference](https://porems.github.io/PoreSim/autoapi/index.html).


## Dependencies

PoreSim supports Python 3.5+.
PoreSim requires Python 3.12+.

Installation requires [pyyaml](https://pypi.org/project/PyYAML/) and [jinja2](https://pypi.org/project/Jinja2/).
Installation requires [pyyaml](https://pypi.org/project/PyYAML/), [numpy](https://numpy.org/), and [jinja2](https://pypi.org/project/Jinja2/).


## Installation

You may instead want to use the development version from GitHub:
The latest stable release can be installed from PyPI:

pip install git+https://github.com/PoreMS/PoreSim.git#egg=poresim
pip install poresim

Or install the development version directly from GitHub:

pip install git+https://github.com/PoreMS/PoreSim.git@develop#egg=poresim
pip install git+https://github.com/PoreMS/PoreSim.git#egg=poresim

Or download the repository and install in the top directory via:

Expand All @@ -37,12 +39,19 @@ Or download the repository and install in the top directory via:

## Testing

To test PoreSim, run the test in the test directory.
Install in editable mode with test dependencies:

pip install -e ".[dev]"

Then run the tests:

pytest tests/test_unit.py # fast unit tests
pytest tests/test_integration.py # full integration tests (slow)


## Development

PoreSim development takes place on Github: [www.github.com/PoreMS/PoreSim](https://github.com/PoreMS/PoreSim)
PoreSim development takes place on GitHub: [www.github.com/PoreMS/PoreSim](https://github.com/PoreMS/PoreSim)

Please submit any reproducible bugs you encounter to the [issue tracker](https://github.com/PoreMS/PoreSim/issues).

Expand All @@ -53,11 +62,11 @@ When citing PoreSim please use the current **Zenodo DOI** corresponding to the u

## Legacy Code Notice

This repository contains the actively maintained and current codebase.
Earlier development stages and archived versions (including those used in publication XYZ) are stored in the following legacy repository:
This repository contains the actively maintained and current codebase.
Earlier development stages and archived versions are stored in the following legacy repository:

[https://github.com/Ajax23/PoreSim](https://github.com/Ajax23/PoreSim)

Please note:
- Legacy versions are no longer actively maintained
- APIs, file formats, and dependencies may differ
- Legacy versions are no longer actively maintained
- APIs, file formats, and dependencies may differ
33 changes: 33 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
# v1.0.0

### Code quality
* `construct.py` — extracted `_write_positions(path, positions)` helper: writes an (N, 3) NumPy position array to a GROMACS position file, replacing repeated inline loops; used for all molecule-insertion position files
* `construct.py` — extracted `_gmx_insert_cmd(folder_gro, file_box, mol, nmol, dr, pos_file)` helper: centralises GROMACS `insert-molecules` command construction with optional `-dr` and `-ip` flags, eliminating duplicated string-building across pore/box/slit code paths
* `actuate.py` — shared folder/file path constants (`_gro/`, `_top/`, `_mdp/`, `box.gro`, `topol.top`, `index.ndx`) extracted from local variables in each method to instance attributes on `Actuate.__init__`; both `_equilibration` and `_simulation` methods now reference `self._folder_*` / `self._file_*`
* `actuate.py` — removed unused `from re import A` import
* `simulate.py` — Jinja2 template rendering for analysis scripts (`auto_dens.py` / `auto_dens_box.py`) refactored: molecule metadata collected into a single `jinja2_dict` loop; `has_fill` flag derived once instead of re-evaluated; template selection unified in a single branch
* Template scripts `auto_dens.py` and `auto_dens_box.py` trimmed; `sort.py` template removed (dead code)
* `tests/data/forhlr.sh` — GROMACS module updated from 2016.5 to 2024.3; `#SBATCH --gres` line added for GPU node support

### Tests
* Converted `tests/test_simple.py` from unittest to pytest
* Split into `test_unit.py` (fast, no file I/O) and `test_integration.py` (full output generation)
* `test_unit.py` — new unit tests: `Box` getter/setter round-trips, `add_mol` validation, `add_topol` all types, `Construct._write_positions` byte-level output, `Construct._gmx_insert_cmd` all flag combinations

### Documentation
* RST source files migrated to MyST Markdown; Sphinx theme updated to furo; API docs via sphinx-autoapi
* Docs source moved from `docsrc/` to `docs/`; previous built HTML preserved at `docs/v_old/`
* Copyright year updated to 2026; DESIGN.md added documenting the yellow/amber color palette

### CI / tooling
* GitHub Actions: added ruff linting workflow (`lint.yml`)
* GitHub Actions: added pip-audit security scan workflow (`security.yml`)
* CI matrix updated: Python 3.12–3.13; `python_requires` bumped to `>=3.12`
* Migrated from `setup.py` + `MANIFEST.in` to a single `pyproject.toml` (PEP 517/621); `[tool.ruff]` config added
* CI migrated from `pip` to `uv` (`astral-sh/setup-uv@v5`); `requirements.txt` removed (deps resolved via `pyproject.toml`)

### Administrative
* `pyproject.toml`: version 1.0.0, `requires-python = ">=3.12"`, author email updated, jinja2 unpinned; `[project.optional-dependencies]` dev group added (`pytest`, `pytest-cov`)
* README: updated image paths, Python version, PyPI badge, testing and installation instructions


# v0.3.0
* New version due to a change of GitHub organisation.

Expand Down
4 changes: 0 additions & 4 deletions docs/.buildinfo

This file was deleted.

File renamed without changes.
Empty file removed docs/.nojekyll
Empty file.
40 changes: 40 additions & 0 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# PoreSim Visual Design

## Color Palette

The logo and all visual assets use a strict 3-color amber palette mirroring the
[Material Design Amber scale](https://m2.material.io/design/color/the-color-system.html),
following the same structural logic as PoreMS (blue) and PoreAna (red).

| Role | Hex | RGB | Material token |
|---|---|---|---|
| Bond lines | `#ECD078` | `rgb(236, 208, 120)` | Amber 200 |
| Small/medium nodes, accent text ("SIM") | `#CA8B32` | `rgb(202, 139, 50)` | Amber 700 |
| Large anchor nodes, body text ("PORE") | `#92400E` | `rgb(146, 64, 14)` | Amber 900 |

### Rationale

- **3 colors maximum** keeps the graphic legible at small sizes (favicon, sidebar logo).
- **Perceptual hierarchy** matches PoreMS exactly: bonds are the lightest element (connectors),
large anchor nodes are the darkest (structural weight).
- **Material Amber scale** provides perceptually uniform steps and is visually distinct from
PoreMS (blue) and PoreAna (red) while sharing the same design grammar.

## Logo Files

| File | Usage |
|---|---|
| `docs/pics/logo.svg` | Square icon (favicon source, app icon) |
| `docs/pics/logo_text.svg` | Horizontal logo with "PoreSim" wordmark |
| `docs/pics/logo_text_sub.svg` | Logo with wordmark + subtitle line |

## Typography

Wordmark uses **Arial / Arial MT** (system sans-serif fallback).
- "**PORE**": Amber 900 (`#92400E`) — darkest, matches large anchor nodes
- "**SIM**": Amber 700 (`#CA8B32`) — medium, matches small/medium nodes

## Favicon

The favicon is derived from `logo.svg`. At 32 × 32 px the three-level amber scheme remains
distinguishable because the large anchor nodes (Amber 900) contrast against the bond lines (Amber 200).
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

SPHINXOPTS =
ifdef OS
SPHINXBUILD = python -msphinx
else
SPHINXBUILD = python3 -msphinx
endif
SPHINXPROJ = PoreSim
SOURCEDIR = .
BUILDDIR = _build

help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Binary file removed docs/_images/2phase_il.pdf
Binary file not shown.
Binary file removed docs/_images/pore_il.pdf
Binary file not shown.
49 changes: 0 additions & 49 deletions docs/_sources/api.rst.txt

This file was deleted.

Loading
Loading