[BUG] Total Pair Distribution Function is NaN
Description of the error If a trajectory contains 1 atom of a specific element, the partial PDF for this atom will be NaN, and subsequently the total PDF will also be NaN, even though other partials were all calculated correctly.
Describe the expected result It would be better if the partial PDF of the single atom was 0.
Describe the actual result The total PDF cannot be saved correctly or plotted afterwards.
Suggested fix Would an application of np.nan_to_num to the partials be justified and sufficient here?
Additional details N/A
Are there other jobs with the same issue when a trajectory contains one atom?
I'd imagine the static structure factor and dynamic coherent structure factor might also have a similar issue.
So far my testing has confirmed that:
- Static structure factor is affected too.
- Dynamic Coherent Structure Factor is not.
This problem does not occur anymore with the current code from the main branch.