Shape Getters#

Module for defining various convenience functions for shape generation.

The methods here provide routes for generating instances of Shape based on certain pre-specified mappings.

Functions:

from_gsd_type_shapes(params[, dimensions])

Create a Shape from a dict conforming to the GSD schema.

coxeter.shape_getters.from_gsd_type_shapes(params, dimensions=3)#

Create a Shape from a dict conforming to the GSD schema.

See here for the specification of the schema. Note that the schema does not differentiate between 2D and 3D shapes for spheres (vs. circles) and ellipsoids (vs. ellipses) because in context the dimensionality of those shapes can be inferred from simulation boxes. To address this ambiguity, this function accepts a dimensions parameter that can be used to disambiguate explicitly between these two cases.

Parameters:
  • params (dict) – The parameters of the shape to construct.

  • dimensions (int) – The dimensionality of the shape (either 2 or 3). Ignored except when the shape is a sphere or an ellipsoid, in which case a value of 2 is used to indicate generating a Circle or Ellipse instead of a Sphere or Ellipsoid (Default value: 3).

Returns:

The desired shape.

Return type:

Shape