Python toolkit for building and analyzing 2D COF stacking-energy landscapes.
Project description
COF-Landscaper
COF-Landscaper is a Python package for building and analyzing 2D COFs.
Researchers interested in applying COF-Landscaper to their own systems are welcome to contact me at gjl342@student.bham.ac.uk. Depending on availability and the scope of the project, I may be able to provide support or explore a possible collaboration.
Platform Support
- Tested on macOS and Linux.
- Microsoft Windows is currently not tested.
Installation
COF-Landscaper requires Python 3.12.
First open a terminal and check whether Python 3.12 is available:
python3.12 --version
If this command returns a Python 3.12 version, continue with the virtual environment setup below.
If you see an error such as command not found: python3.12, install Python 3.12 first.
On macOS, Python 3.12 can be installed with Homebrew:
brew install python@3.12
After installation, check again:
python3.12 --version
Create a virtual environment.
python3.12 -m venv coflandscaper
Activate the virtual environment.
source coflandscaper/bin/activate
Upgrade pip.
pip install --upgrade pip
Install COF-Landscaper from PyPI.
pip install cof-landscaper
Example Files
After installation, COF-Landscaper can be imported and used directly in your own Python scripts or notebooks.
If you want to start from the provided example workflows, run:
cof-landscaper-copy-examples
This copies the example files into the current directory under:
examples/
The copied examples include an executable Python workflow under:
examples/python/
This folder contains the workflow script and a separate cof-landscaper.params.json file where the workflow settings can be configured. It also includes a minimal notebook for plotting simulated PXRD data together with experimental PXRD data after the workflow has finished.
The copied examples also include three notebook versions under:
examples/notebook/
The notebook versions are:
cof-landscaper_configurable.ipynb: full notebook with Markdown explanations for all configurable options.cof-landscaper_default.ipynb: default workflow notebook with explanations for the default settings.cof-landscaper_minimal.ipynb: minimal code-only workflow for running the notebook without extended explanations.
You can then edit the copied Python script, JSON parameter file, notebook, and input .xyz files for your own system.
Running the Notebooks
Install Jupyter support if you want to run the notebooks.
pip install jupyter ipykernel
Register the environment as a Jupyter kernel.
python -m ipykernel install --user --name coflandscaper --display-name "Python (coflandscaper)"
In VS Code or Jupyter, select the kernel:
Python (coflandscaper)
Run a test cell:
import coflandscaper as cl
Developer Setup
Install just.
Install uv.
Clone the repository and enter the source directory.
git clone https://github.com/GregorLauter/COF-Landscaper.git
cd COF-Landscaper
Set up the development environment.
just setup
Run code checks.
just check
Workflow Notes
- The DFT (Crystal23) workflow requires additional external HPC infrastructure.
- The MLIP workflow can be executed on a local machine, but GPU access can provide a substantial speedup.
- For large systems, long screening workflows, or cases where local hardware is limiting, running the workflow on an external GPU or CPU cluster is recommended.
- If you are interested in applying COF-Landscaper but do not have access to suitable computational resources, feel free to contact me.
Workflow diagram:
Required Input Files
The workflow requires building-block fragments provided as .xyz files.
In COF-Landscaper, the terms node and linker refer to the structural fragments used by the builder to assemble the framework. They do not necessarily correspond one-to-one to synthetic precursors. In practice, the node and linker files should represent the molecular fragments that are connected during structure generation.
The schematic below illustrates this distinction for COF-1:
Node and linker fragments used for COF-1 structure generation:
Supported topologies:
| Topology | Keyword | Description | Node amount | Node connectivity | Linker amount | Linker connectivity |
|---|---|---|---|---|---|---|
| Honeycomb | hcb |
standard honeycomb. | 1 | 3 | 1 | 2 |
| Square lattice | sql |
1 | 4 | 1 | 2 | |
| Binary honeycomb | hcb_ab |
two different nodes nodes with no linker inbetween them linker. | 2 | 3 each | 0 | — |
| Kagome | kgm |
1 | 4 | 1 | 2 |
Connection Points
Connection points must be marked with helium atoms (He) in the input .xyz files.
During preprocessing, COF-Landscaper converts these He atoms into pormake-compatible connection points. The number and geometry of the He atoms must match the selected topology and the intended connectivity shown in the table above.
Input requirements:
hcb,sql, andkgmrequire one node.xyzfile and one linker.xyzfile.hcb_abrequires two node.xyzfiles and no linker file.- By default, node files are read from
0_node/. - By default, linker files are read from
0_linker/when required by the topology. - Explicit paths can be provided with
input_nodes=[...]andinput_linkers=[...].
Input fragments should ideally be pre-optimized with a generic force field, such as UFF, to remove severe steric clashes and obtain reasonable approximate bond lengths.
The subsequent pre-optimization step handles the assembled framework. Therefore, the main requirement at this stage is that the individual fragments are chemically sensible and can be connected cleanly by the builder.
The .xyz files can be prepared using any suitable molecular editor or visualizer, for example Avogadro, Mercury, or DrawMol.
Where To Find Explanations
The full documentation is available on Read the Docs:
Additional stepwise explanations of the computational workflow are provided in the Markdown cells of the example notebooks.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cof_landscaper-2026.6.1.0.tar.gz.
File metadata
- Download URL: cof_landscaper-2026.6.1.0.tar.gz
- Upload date:
- Size: 6.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a87f2ecf1a9323615aa75f2a973f1efe40f1bd94a43cd6a9045a839fbc052efa
|
|
| MD5 |
38d4b08551b9639f3c1e7c8eca642a36
|
|
| BLAKE2b-256 |
55a8aadf3f183894401e87b68969c14b3625bca6dbb9cde540b5eb5a3b5b5954
|
File details
Details for the file cof_landscaper-2026.6.1.0-py3-none-any.whl.
File metadata
- Download URL: cof_landscaper-2026.6.1.0-py3-none-any.whl
- Upload date:
- Size: 59.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
834139b102535ba7d5fdccd6807e3a0f7286c686d14d9d8c060c6bedbe8c4b64
|
|
| MD5 |
6b86be762e8b5481a9e6cc15802bbcda
|
|
| BLAKE2b-256 |
296ddd07ba4b207ba65b344c58f2fda4f6b33af9ce749e46e1741d7da49ab1e1
|