Installing XANESNET
Download
XANESNET can be cloned from GitHub or GitLab:
git clone https://github.com/NewcastleRSE/XANESNET.git
or
git clone https://gitlab.com/team-xnet/xanesnet.git
The repository contains source code, example configs under configs/, and toy data under data/.
Training datasets for first-row transition-metal X-ray absorption and emission can be obtained separately:
git clone https://gitlab.com/team-xnet/training-sets.git
Requirements
Linux (tested on Ubuntu)
Python 3.12 and above
A C/C++ build toolchain if pip needs to compile native PyTorch Geometric extensions.
Optional: NVIDIA GPU and CUDA-compatible PyTorch wheels for
device: cuda.
The Lightning trainer is an optional extra. Install it with python -m pip install -e ".[lightning]" when using trainer_type: lightning.
The tested Lightning environment uses Python 3.12.9 and PyTorch 2.5.1 with CUDA 12.4.
CPU-only training does not require CUDA. MPS devices are currently unsupported and untested.
Installation
Install the package from the XANESNET repository root:
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -e .
For a non-editable install:
python -m pip install .
To use the optional Lightning trainer, include its extra:
python -m pip install -e ".[lightning]"
Verify the installation:
xanesnet --help
Continue with Running XANESNET for command-line workflows and Input files for configuration files.
For the work-in-progress browser-based config editor, see Configuration editor.
PyTorch and PyTorch Geometric
XANESNET depends on PyTorch and PyTorch Geometric.
On Linux with CPU-only PyTorch, a normal pip install is often enough.
For CUDA, or if packages such as torch-scatter, torch-sparse, or torch-cluster fail to install,
install matching wheels for your Python, PyTorch, and CUDA versions first, then install XANESNET.
Example for PyTorch 2.5 with CUDA 12.4:
python -m pip install torch --index-url https://download.pytorch.org/whl/cu124
python -m pip install torch-scatter torch-sparse torch-cluster -f https://data.pyg.org/whl/torch-2.5.1+cu124.html
python -m pip install -e .
Adjust the wheel URLs for your target platform. The PyTorch and PyTorch Geometric installation guides are the source of truth for the current compatibility matrix.