Skip to content

BUG: Fix to Amber read_coordinates routine for varying NetCDF return

Nicholas Hine requested to merge ndmhine/ase:amber_read_coord_fix into master

This fixes a previous fix to the Amber calculator, which was intended to cope with the fact that objects of differing numbers of dimensions could be returned to the fin.variables array, depending on whether a single frame or a long trajectory was being read.

This previous fix did not account for the fact that there seem to be different versions of the NetCDF routines, some of which return an object whose dimensions are specified by "shape", whereas some of them are specified by "ndim". Without wanting to get into the details of checking for which version is present, this is a fix that just checks for which of the two attributes ("shape" or "ndim") is present, and uses the appropriate one.

Merge request reports