Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
consistently indicate absence of box information `Timestep.dimensions` #1738
When a trajectory does not contain a unit cell, then
Readers decide for themselves how they handle missing box information. For example:
See discussion #1733 (comment)
Code to reproduce the behaviour
import MDAnalysis as mda from MDAnalysis.tests.datafiles import XYZ, PSF, DCD xyz = mda.Universe(XYZ) print(xyz.trajectory.ts.dimensions) dcd = mda.Universe(PSF, DCD) print(dcd.trajectory.ts.dimensions)
Currently version of MDAnalysis:
referenced this issue
Dec 13, 2017
I'd rather have None. Most (all?) "box=" keywords use None to signify no pbc, so if we used None then we could blindly pass dimensions.
That said, there's also the issue of dealing with periodicity in only a few dimensions (eg bilayer you don't want pbc normal to lipid plane). If we did allow length=0 to mean no pbc, then semi periodic is a lot easier to deal with.
So maybe we should allow length=0
We could add a has_pbc or is_periodic attribute to Timestep. But as @richardjgowers pointed out, what do you do with semi periodic systems? Having 0 lengths for non-periodic dimensions seems the cleanest approach to me. Maybe a function that returns the dimensions (axes) along a box is periodic, and then you can check for no pbc i.e.  or 1d e.g. , 2D e.g. [1,2], 3D [0,1,2] periodicity by asking how many axes you got back.…
-- Oliver Beckstein email: firstname.lastname@example.org
Am Dec 13, 2017 um 08:18 schrieb Jose Borreguero ***@***.***>: @orbeckst Can you also write a utility function that will return False if the system is non-periodic in order to hide the particular definition of non-periodic dimensions that you will settle for? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.