ISISNeutronMuon / ISISNeutronMuon/MDANSE

[BUG] AverageStructure doesn't work with artificial atoms

Open
#952 0 comments 0 reactions 0 assignees View on GitHub
bug framework
Dominant language
Python
Stars
29
Forks
8
Avg merge
2d 12h
Merged PRs (30d)
9

Description

**Description of the error**
AverageStructure uses ASE classes for writing the output file, to take advantage of the multiple formats supported by ASE. However, ASE only allows atoms to correspond to known chemical elements. At the moment, isotopes are replaced with natural-abundance elements, and artificial atoms make the run fail.

**Describe the expected result**
Ideally, we should be able to write the average structure of any trajectory. The chemical composition is irrelevant to the average structure, which should only deal with coordinates of atoms and dimensions of the unit cell.

**Describe the actual result**
Trajectories created with CenterOfMassesTrajectory will cause AverageStructure to fail with a `KeyError`, as `ASE.Atoms` will not recognise the atom symbol.

**Suggested fix**
At the moment, there are several possible solutions:
1. Implement just a few output formats on our side and stop using ASE.
2. Try to subclass `ASE.Atom` and `ASE.Atoms` to stop them from forcing atoms to be known chemical elements.
3. Replace artificial atoms with chemical elements not present in the system, and try to change the labels in post-processing once the file has been written out.

**Additional details**
N/A

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing AverageStructure's ASE-based output path and how CenterOfMassesTrajectory supplies artificial atom symbols. Review the available output formats and the failure point causing the KeyError. Done means an average structure can be written for trajectories with artificial atoms, using coordinates and unit-cell dimensions without requiring known chemical elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.