I've been playing with v0.2.2-alpha and am puzzled by the behavior for empty steps.
In [66]: tng[0].get_positions(positions)
Out[66]:
array([[2.5329998 , 1.244 , 3.5059998 ],
[0.8299999 , 2.544 , 3.4479997 ],
[1.091 , 0.10999999, 3.1289997 ],
...,
[3.2949998 , 2.8899999 , 1.9889998 ],
[0.22999999, 0.92599994, 1.0619999 ],
[3.0709999 , 2.495 , 3.5249999 ]], dtype=float32)
In [67]: tng[1].get_positions(positions)
Out[67]:
array([[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan],
...,
[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan]], dtype=float32)
In [68]: tng[2].get_positions(positions)
Out[68]:
array([[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan],
...,
[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan]], dtype=float32)
In [69]: tng[0].get_positions(positions)
Out[69]:
array([[2.5329998 , 1.244 , 3.5059998 ],
[0.8299999 , 2.544 , 3.4479997 ],
[1.091 , 0.10999999, 3.1289997 ],
...,
[3.2949998 , 2.8899999 , 1.9889998 ],
[0.22999999, 0.92599994, 1.0619999 ],
[3.0709999 , 2.495 , 3.5249999 ]], dtype=float32)
In [70]: tng[1].get_positions(positions)
Out[70]:
array([[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan],
...,
[nan, nan, nan],
[nan, nan, nan],
[nan, nan, nan]], dtype=float32)
Now looking at steps at the end of the trajectory that should not contain data (-2) vs one that does (the last frame) โ just to show the frame numbers:
i.e. the last frame with data is -1 from the unsliced trajectory.
But when I access steps from the end of the trajectory, the data for -2 just repeats the data from the last frame with data (-1) instead of giving a NAN array:
In [71]: tng[-1].get_positions(positions)
Out[71]:
array([[0.43999997, 0.38899997, 1.374 ],
[1.4319999 , 1.6489999 , 2.939 ],
[2.0149999 , 2.103 , 2.6569998 ],
...,
[2.0849998 , 3.5509996 , 1.4359999 ],
[0.15599999, 3.5019999 , 0.31399998],
[1.2889999 , 0.9979999 , 1.6449999 ]], dtype=float32)
In [72]: tng[-2].get_positions(positions)
Out[72]:
array([[0.43999997, 0.38899997, 1.374 ],
[1.4319999 , 1.6489999 , 2.939 ],
[2.0149999 , 2.103 , 2.6569998 ],
...,
[2.0849998 , 3.5509996 , 1.4359999 ],
[0.15599999, 3.5019999 , 0.31399998],
[1.2889999 , 0.9979999 , 1.6449999 ]], dtype=float32)