Skip to content
Open
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
12 changes: 9 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: windows-2022
python: 312
platform_id: win_amd64
- os: ubuntu-latest
python: 312
platform_id: manylinux_x86_64
- os: macos-latest
- os: macos-14
python: 312
macos_target: 14
platform_id: macosx_arm64
Expand Down Expand Up @@ -65,6 +65,12 @@ jobs:
shell: msys2 {0}
env:
PYTHONIOENCODING: utf-8
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
if: runner.os != 'Windows'
with:
compiler: gcc
version: latest
- uses: pypa/cibuildwheel@v3.1.1
if: runner.os != 'Windows'
env:
Expand All @@ -73,7 +79,7 @@ jobs:
UV_INDEX: https://pypi.org/simple
UV_DEFAULT_INDEX: https://pypi.org/simple
CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel"
CIBW_BEFORE_ALL_MACOS: "brew install openblas gfortran"
CIBW_BEFORE_ALL_MACOS: "brew install openblas"
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target }}.0
- run: ls -l wheelhouse/*
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ jobs:
matrix:
include:
# win-64
- os: windows-latest
- os: windows
python: 39
platform_id: win_amd64
- os: windows-latest
- os: windows-2022
python: 310
platform_id: win_amd64
- os: windows-latest
- os: windows-2022
python: 311
platform_id: win_amd64
- os: windows-latest
- os: windows-2022
python: 312
platform_id: win_amd64
- os: windows-latest
- os: windows-2022
python: 313
platform_id: win_amd64
- os: windows-latest
- os: windows-2022
python: 313t
platform_id: win_amd64
cibw_enable: cpython-freethreading
- os: windows-latest
- os: windows-2022
python: 314
platform_id: win_amd64
- os: windows-latest
- os: windows-2022
python: 314t
platform_id: win_amd64
cibw_enable: cpython-freethreading
Expand Down Expand Up @@ -287,15 +287,21 @@ jobs:
pipx run --python 3.13 delvewheel==1.10 repair dist/*.whl -vv
if: runner.os == 'Windows'
shell: msys2 {0}
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
if: runner.os != 'Windows'
with:
compiler: gcc
version: latest
- uses: pypa/cibuildwheel@v3.1.1
if: runner.os != 'Windows'
env:
CIBW_ARCHS: all
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT_MACOS: FC=gfortran
CIBW_ENABLE: ${{ matrix.cibw_enable }}
CIBW_BEFORE_ALL_LINUX: "yum install -y openblas-devel"
CIBW_BEFORE_ALL_MACOS: "brew install openblas gfortran"
CIBW_ENVIRONMENT_MACOS: CC=gcc-13 CXX=g++-13 FC=gfortran-13
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target }}.0
Expand Down Expand Up @@ -369,6 +375,6 @@ jobs:
conda config --set anaconda_upload yes
export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }}
for file in conda-dist/*; do
anaconda upload $file
anaconda upload $file -c conda-forge
done
shell: micromamba-shell {0}
84 changes: 0 additions & 84 deletions AGENTS.md

This file was deleted.

38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,46 @@
[![Pypi version](https://img.shields.io/pypi/v/pygfnff)](https://pypi.org/project/pygfnff/)
[![PyPI Downloads](https://static.pepy.tech/badge/pygfnff)](https://pepy.tech/projects/pygfnff)

This is a Python version for [GFN-FF](https://github.com/pprcht/gfnff) based on F2PY.
PyGFNFF is a Python library that provides the [GFN-FF](https://github.com/pprcht/gfnff) (Generic Force Field) method for computational chemistry calculations. It is based on F2PY (Fortran to Python interface) and integrates with the Atomic Simulation Environment (ASE).

---

## Project Structure

```
PyGFNFF/
├── pygfnff/ # Python package
│ ├── __init__.py # Exports GFNFF calculator and gfnff function
│ └── _pygfnff.py # Main implementation
├── fortran/ # Fortran source code
│ ├── gfnff_*.f90 # GFN-FF modules
│ ├── _pygfnfflib.f90 # F2PY interface
│ ├── CMakeLists.txt # Fortran build configuration
│ └── gbsa/ # GBSA solvation model
├── include/ # C header and parameter files
│ ├── gfnff_interface_c.h
│ └── param_*.fh # Parameter files for solvents
├── tests/ # Test suite
│ ├── test_co_by_ase.py
│ └── test_coffeine.py
├── CMakeLists.txt # Root CMake configuration
└── pyproject.toml # Python project configuration
```

## Key Components

### Python Interface (`pygfnff/`)

- **`GFNFF`**: ASE Calculator subclass for non-PBC systems
- **`gfnff()`**: Low-level function for single-point energy calculations

### Fortran Backend (`fortran/`)

- GFN-FF implementation derived from https://github.com/pprcht/gfnff (commit 0491df2)
- GBSA solvation model support (optional, enabled via CMake `WITH_GBSA`)
- F2PY bindings via `_pygfnfflib.f90`


## Usage

There is an `ase.Calculator` subclass termed `GFNFF` for non-PBC system. And a more low function called `gfnff` can be found in [the code](https://github.com/LiuGaoyong/PyGFNFF/blob/main/pygfnff/_pygfnff.py).
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "pygfnff"
version = "v0.0.3"
version = "v0.0.4"
description = "A Python Library for GFN-FF."
readme = "README.md"
authors = [{ name = "Liu Gaoyong", email = "liugaoyong_88@163.com" }]
Expand Down
4 changes: 2 additions & 2 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading