Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Repository
Tools for machine learnt interatomic potentials
Basic Info
- Host: GitHub
- Owner: stfc
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Homepage: https://stfc.github.io/janus-core/
- Size: 111 MB
Statistics
- Stars: 34
- Watchers: 7
- Forks: 12
- Open Issues: 47
- Releases: 38
Metadata Files
README.md
janus-core

Tools for machine learnt interatomic potentials
Contents
Getting started
Dependencies
All required and optional dependencies can be found in pyproject.toml.
Installation
The latest stable release of janus-core, including its dependencies, can be installed from PyPI by running:
python3 -m pip install janus-core
To get all the latest changes, janus-core can also be installed from GitHub:
python3 -m pip install git+https://github.com/stfc/janus-core.git
By default, no machine learnt interatomic potentials (MLIPs) will be installed with janus-core. These can be installed separately, or as extras.
For example, to install MACE, CHGNet, and SevenNet, run:
python
python3 -m pip install janus-core[mace,chgnet,sevennet]
[!WARNING] We are unable to support for automatic installation of all combinations of MLIPs, or MLIPs on all platforms. Please refer to the installation documentation for more details.
To install all MLIPs currently compatible with MACE, run:
python
python3 -m pip install janus-core[all]
Individual extras are listed in Getting Started, as well as in pyproject.toml under [project.optional-dependencies].
Further help
Please see Getting Started, as well as guides for janus-core's Python and command line interfaces, for additional information, or open an issue if something doesn't seem right.
Features
Unless stated otherwise, MLIP calculators and calculations rely heavily on ASE.
Current and planned features include:
- [x] Support for multiple MLIPs
- MACE
- M3GNet
- CHGNet
- ALIGNN
- SevenNet
- NequIP
- DPA3
- Orb
- MatterSim
- GRACE
- EquiformerV2
- eSEN
- UMA
- PET-MAD
- [x] Single point calculations
- [x] Geometry optimisation
- [x] Molecular Dynamics
- NVE
- NVT (Langevin(Eijnden/Ciccotti flavour) and Nos-Hoover (Melchionna flavour))
- NPT (Nos-Hoover (Melchiona flavour))
- [x] Nudged Elastic Band
- [x] Phonons
- Phonopy
- [x] Equation of State
- [x] Training ML potentials
- MACE
- [x] Fine-tuning MLIPs
- MACE
- [x] MLIP descriptors
- MACE
- [x] Data preprocessing
- MACE
- [x] Rare events simulations
- PLUMED
Python interface
Calculations can also be run through the Python interface. For example, running:
```python from januscore.calculations.singlepoint import SinglePoint
singlepoint = SinglePoint( struct="tests/data/NaCl.cif", arch="macemp", modelpath="tests/models/macemp_small.model", )
results = single_point.run() print(results) ```
will read the NaCl structure file and attach the MACE-MP (medium) calculator, before calculating and printing the energy, forces, and stress.
Jupyter Notebook tutorials illustrating the use of currently available calculations can be found in the tutorials documentation directory. This currently includes examples for:
Calculation outputs
By default, calculations performed will modify the underlying ase.Atoms object
to store information in the Atoms.info and Atoms.arrays dictionaries about the MLIP used.
Additional dictionary keys include arch, corresponding to the MLIP architecture used,
and model_path, corresponding to the model path, name or label.
Results from the MLIP calculator, which are typically stored in Atoms.calc.results, will also, by default,
be copied to these dictionaries, prefixed by the MLIP arch.
For example:
```python from januscore.calculations.singlepoint import SinglePoint
singlepoint = SinglePoint( struct="tests/data/NaCl.cif", arch="macemp", modelpath="tests/models/macemp_small.model", )
singlepoint.run() print(singlepoint.struct.info) ```
will return
python
{
'spacegroup': Spacegroup(1, setting=1),
'unit_cell': 'conventional',
'occupancy': {'0': {'Na': 1.0}, '1': {'Cl': 1.0}, '2': {'Na': 1.0}, '3': {'Cl': 1.0}, '4': {'Na': 1.0}, '5': {'Cl': 1.0}, '6': {'Na': 1.0}, '7': {'Cl': 1.0}},
'model_path': 'tests/models/mace_mp_small.model',
'arch': 'mace_mp',
'mace_mp_energy': -27.035127799332745,
'mace_mp_stress': array([-4.78327600e-03, -4.78327600e-03, -4.78327600e-03, 1.08000967e-19, -2.74004242e-19, -2.04504710e-19]),
'system_name': 'NaCl',
}
[!NOTE] If running calculations with multiple MLIPs,
archandmlip_modelwill be overwritten with the most recent MLIP information. Results labelled by the architecture (e.g.mace_mp_energy) will be saved between MLIPs, unless the samearchis chosen, in which case these values will also be overwritten.
This is also the case the calculations performed using the CLI, with the same information written to extxyz output files.
[!TIP] For complete provenance tracking, calculations and training can be run using the aiida-mlip AiiDA plugin.
Command line interface
All supported MLIP calculations are accessible through subcommands of the janus command line tool, which is installed with the package:
shell
janus singlepoint
janus geomopt
janus md
janus phonons
janus eos
janus neb
janus train
janus descriptors
janus preprocess
For example, a single point calcuation (using the MACE-MP "small" force-field) can be performed by running:
shell
janus singlepoint --struct tests/data/NaCl.cif --arch mace_mp --model-path small
A description of each subcommand, as well as valid options, can be listed using the --help option. For example,
shell
janus singlepoint --help
prints the following:
```shell Usage: janus singlepoint [OPTIONS]
Perform single point calculations and save to file.
Options: --struct PATH Path of structure to simulate. [required] --arch TEXT MLIP architecture to use for calculations. [default: macemp] --device TEXT Device to run calculations on. [default: cpu] --model-path TEXT Path to MLIP model. [default: None] --properties TEXT Properties to calculate. If not specified, 'energy', 'forces' and 'stress' will be returned. --out PATH Path to save structure with calculated results. Default is inferred from name of structure file. --read-kwargs DICT Keyword arguments to pass to ase.io.read. Must be passed as a dictionary wrapped in quotes, e.g. "{'key' : value}". [default: "{}"] --calc-kwargs DICT Keyword arguments to pass to selected calculator. Must be passed as a dictionary wrapped in quotes, e.g. "{'key' : value}". For the default architecture ('macemp'), "{'model':'small'}" is set unless overwritten. --write-kwargs DICT Keyword arguments to pass to ase.io.write when saving results. Must be passed as a dictionary wrapped in quotes, e.g. "{'key' : value}". [default: "{}"] --log PATH Path to save logs to. Default is inferred from the name of the structure file. --summary PATH Path to save summary of inputs, start/end time, and carbon emissions. Default is inferred from the name of the structure file. --config TEXT Configuration file. --help Show this message and exit. ```
Please see the user guide for examples of each subcommand.
Using configuration files
Default values for all command line options may be specifed through a Yaml 1.1 formatted configuration file by adding the --config option. If an option is present in both the command line and configuration file, the command line value takes precedence.
For example, with the following configuration file and command:
yaml
struct: "NaCl.cif"
properties:
- "energy"
out: "NaCl-results.extxyz"
arch: mace_mp
model-path: medium
calc-kwargs:
dispersion: True
shell
janus singlepoint --arch mace_mp --struct KCl.cif --out KCl-results.cif --config config.yml
This will run a singlepoint energy calculation on KCl.cif using the MACE-MP "medium" force-field, saving the results to KCl-results.cif.
[!NOTE]
propertiesmust be passed as a Yaml list, as above, not as a string.
Minimal and full example configuration files for all calculations can be found here.
Development
We recommend installing uv for dependency management when developing for janus-core:
- Install uv
- Install
janus-corewith dependencies in a virtual environment:
shell
git clone https://github.com/stfc/janus-core
cd janus-core
uv sync --extras all # Create a virtual environment and install dependencies
source .venv/bin/activate
pre-commit install # Install pre-commit hooks
pytest -v # Discover and run all tests
License
Funding
Contributors to this project were funded by
Owner
- Name: UKRI Science and Technology Facilities Council
- Login: stfc
- Kind: organization
- Location: UK
- Website: https://www.scd.stfc.ac.uk
- Repositories: 78
- Profile: https://github.com/stfc
GitHub Events
Total
- Create event: 23
- Release event: 12
- Issues event: 162
- Watch event: 20
- Delete event: 20
- Member event: 2
- Issue comment event: 224
- Push event: 162
- Pull request review comment event: 439
- Pull request event: 274
- Pull request review event: 606
- Fork event: 5
Last Year
- Create event: 23
- Release event: 12
- Issues event: 162
- Watch event: 20
- Delete event: 20
- Member event: 2
- Issue comment event: 224
- Push event: 162
- Pull request review comment event: 439
- Pull request event: 274
- Pull request review event: 606
- Fork event: 5
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 229
- Total pull requests: 314
- Average time to close issues: 29 days
- Average time to close pull requests: 6 days
- Total issue authors: 10
- Total pull request authors: 11
- Average comments per issue: 0.69
- Average comments per pull request: 0.76
- Merged pull requests: 226
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 99
- Pull requests: 164
- Average time to close issues: 27 days
- Average time to close pull requests: 7 days
- Issue authors: 8
- Pull request authors: 9
- Average comments per issue: 0.39
- Average comments per pull request: 0.91
- Merged pull requests: 112
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ElliottKasoar (136)
- alinelena (67)
- k-harris27 (6)
- ajjackson (6)
- harveydevereux (5)
- oerc0122 (4)
- federicazanca (2)
- epatyukova (1)
- catastropiyush (1)
- RastislavTuranyi (1)
Pull Request Authors
- ElliottKasoar (241)
- alinelena (32)
- oerc0122 (14)
- k-harris27 (10)
- harveydevereux (9)
- RastislavTuranyi (2)
- catastropiyush (2)
- trdurrant (1)
- ajjackson (1)
- carlosbornes (1)
- MBartkowiakSTFC (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 1,732 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 36
- Total maintainers: 1
pypi.org: janus-core
Tools for machine learnt interatomic potentials
- Documentation: https://stfc.github.io/janus-core/
- License: BSD License
-
Latest release: 0.8.3
published 11 months ago
Rankings
Maintainers (1)
Dependencies
- coverage ^7.4.1 develop
- pgtest ^1.3.2 develop
- pytest ^8.0 develop
- pytest-cov ^4.1.0 develop
- wheel ^0.42 develop
- furo ^2024.1.29 docs
- markupsafe <2.1 docs
- sphinx ^7.2.6 docs
- sphinxcontrib-contentui ^0.2.5 docs
- sphinxcontrib-details-directive ^0.1 docs
- black ^24.1.1 pre-commit
- pre-commit ^3.6.0 pre-commit
- pylint ^2.15.10 pre-commit
- ase ^3.22.1
- python ^3.9
- actions/checkout v4 composite
- actions/setup-python v5 composite
- coverallsapp/github-action v2 composite
- actions/checkout v4 composite
- actions/deploy-pages v4 composite
- actions/upload-pages-artifact v3 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- ncipollo/release-action v1 composite

