mindscience.data.FixedPoint

class mindscience.data.FixedPoint(name, coord, dtype=numpy.float32, sampling_config=None)[source]

Definition of fixed point object.

Parameters
  • name (str) – Name of the fixed point.

  • coord (Union[int, float, tuple, list, numpy.ndarray]) – Coordinate of the fixed point. If the parameter type is tuple or list, each element should be of type int or float.

  • dtype (numpy.dtype) – Data type of sampled point data type. Default: numpy.float32.

  • sampling_config (SamplingConfig) – Sampling configuration. Default: None.

Examples

>>> from mindscience.data import generate_sampling_config, FixedPoint
>>> hypercube_random = dict({
...      'domain': dict({
...          'random_sampling': True,
...          'size': 1,
...          'sampler': 'uniform'
...         })
...  })
>>> sampling_config = generate_sampling_config(hypercube_random)
>>> point = FixedPoint("FixedPoint", [-1, 2, 1], sampling_config=sampling_config)
>>> domain = point.sampling(geom_type="domain")
>>> print(domain.shape)
(1, 3)
sampling(geom_type='domain')[source]

Sampling points.

Parameters

geom_type (str) – Geometry type, which supports 'domain' and 'BC'. Default: 'domain'.

Returns

Numpy.ndarray, 2D numpy array with or without boundary normal vectors.

Raises
  • KeyError – If geom_type is 'domain' but self.sampling_config.domain is None.

  • KeyError – If geom_type is 'BC' but self.sampling_config.bc is None.

  • ValueError – If geom_type is neither 'BC' nor 'domain'.