You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In PR #481, we are adding the definition to slice array properties with a syntax similar to:
property_slices=dim_sites:3:5:1
to get only values where the index of the axes with dimension name dim_sites is 3, 4 or 5.
This means that if two different arrays sharing that dimension are requested via response_fields, e.g. cartesian_site_positions and species_at_sites, the query above will slice both arrays.
This is typically what one wants and covers most (if not all) current usecases.
However, there are some corner cases where this is too strict.
E.g., let us consider a matrix of interactions between atoms in a molecule (let's call it _exmpl_sites_interactions), therefore with dimensions [dim_sites, dim_sites].
One might then want to slice only on the first axis (to obtain the iterations of one atom, say atom with index 4, with all other atoms in the molecule).
With the current syntax, instead, one can only either ask the whole matrix, or specifying property_slices=dim_sites:4:4:1 will only return a 1x1 block, the interaction of atom with index 4 with itself.
This is already sub-optimal, because then the only way is to get the whole matrix, that might be very big (imagine a big protein).
In addition, this is even more problematic if the server only declares one of the two axes as sliceable and not the other: then, even in the case where requesting a square sub-block would be sufficient, the query might actually return an error.
We therefore suggest to extend, in the future, the property_slices definition to allow also to query for a specific index of a specific array property.
With the current proposed syntax of property_slices=dim_sites:3:5:1, this could e.g. be property_slices=dim_sites:2:10:1,_exmpl_sites_iteractions[0]:4:4:1
This means that in general I only want information on atoms with indices from 2 to 10 (e.g. for arrays cartesian_site_positions), but for the _exmpl_sites_iteractions I want the sub-block where the index for the first axis (0) of the array is 4 (while the second, being unspecified, gets the slice from dim_sites: therefore we are requesting a 1x9 block: a dimension is overridden by this array-index-specific specification).
The text was updated successfully, but these errors were encountered:
In PR #481, we are adding the definition to slice array properties with a syntax similar to:
to get only values where the index of the axes with dimension name
dim_sites
is 3, 4 or 5.This means that if two different arrays sharing that dimension are requested via
response_fields
, e.g.cartesian_site_positions
andspecies_at_sites
, the query above will slice both arrays.This is typically what one wants and covers most (if not all) current usecases.
However, there are some corner cases where this is too strict.
E.g., let us consider a matrix of interactions between atoms in a molecule (let's call it
_exmpl_sites_interactions
), therefore with dimensions[dim_sites, dim_sites]
.One might then want to slice only on the first axis (to obtain the iterations of one atom, say atom with index 4, with all other atoms in the molecule).
With the current syntax, instead, one can only either ask the whole matrix, or specifying
property_slices=dim_sites:4:4:1
will only return a1x1
block, the interaction of atom with index 4 with itself.This is already sub-optimal, because then the only way is to get the whole matrix, that might be very big (imagine a big protein).
In addition, this is even more problematic if the server only declares one of the two axes as sliceable and not the other: then, even in the case where requesting a square sub-block would be sufficient, the query might actually return an error.
We therefore suggest to extend, in the future, the
property_slices
definition to allow also to query for a specific index of a specific array property.With the current proposed syntax of
property_slices=dim_sites:3:5:1
, this could e.g. beproperty_slices=dim_sites:2:10:1,_exmpl_sites_iteractions[0]:4:4:1
This means that in general I only want information on atoms with indices from 2 to 10 (e.g. for arrays
cartesian_site_positions
), but for the_exmpl_sites_iteractions
I want the sub-block where the index for the first axis (0) of the array is 4 (while the second, being unspecified, gets the slice fromdim_sites
: therefore we are requesting a1x9
block: a dimension is overridden by this array-index-specific specification).The text was updated successfully, but these errors were encountered: