stfc / janus-core

Tools for machine learnt interatomic potentials
https://stfc.github.io/janus-core/
BSD 3-Clause "New" or "Revised" License
9 stars 7 forks source link

Standardise model path keyword #202

Closed ElliottKasoar closed 1 month ago

ElliottKasoar commented 1 month ago

As mentioned in #194, it's probably useful to standardise the (optional) path to the input model between MLIPs.

Currently only device is standardised, but given that for provenance (e.g. via aiida-mlip), we always want a way to specify it, and you'd expect it as an option in some form anyway, it would be useful to make it consistent.

It's probably worth aliasing the native names too, where appropriate, as we already do for model/model_paths with MACE.

ElliottKasoar commented 1 month ago

While not the only solution, this could address what is essentially a bug for m3gnet and chgnet.

The model parameter is currently passed as the potential to M3GNetCalculator, but this is expected to be a loaded model (torch.nn.Module), so there's no real way to specify a path to the model at the moment.

I think this is also the case for the CHGNetCalculator calculator, which takes model as a loaded model.

This might also suggest model_path may be the most appropriate abstract name, rather than model.