GEMDAT-repos / GEMDAT

Python toolkit for molecular dynamics analysis
https://gemdat.readthedocs.io
Apache License 2.0
21 stars 3 forks source link

`.n_floating` returns the wrong number #252

Closed stefsmeets closed 8 months ago

stefsmeets commented 8 months ago

The .n_floating attribute on Jumps and Transitions returns the wrong number after #228. It now incorrectly returns 104 (len(trajectory)), whereas previously it returned 48 (len(diff_trajectory)).

I believe this explains some of the differences we saw in the test data in that PR. A quick test shows that by changing the value to 48 manually, I get 1174999999999.9998 for activation energy and 0.1311507276205788 for the rates, much closer to the original.

Previous test data:

def test_rates(self, vasp_sites):
    ...
    assert isclose(rates, 1249999999999.9998)
    assert isclose(rates_std, 137337009020.29002)

def test_activation_energies(self, vasp_sites):
    ...
    assert isclose(e_act, 0.1311852, rel_tol=1e-6)
    assert isclose(e_act_std, 0.00596132, rel_tol=1e-6)

After #228:

def test_rates(self, vasp_jumps):
    ...
    assert isclose(row['rates'], 542307692307.69226)
    assert isclose(row['std'], 41893421993.683655)

def test_activation_energies(self, vasp_jumps):
    ...
    assert isclose(row['energy'], 0.17445, abs_tol=1e-4)
    assert isclose(row['std'], 0.004059, abs_tol=1e-6)