CakeDict

class CakeDict(*args, **kwargs)[source]

Bases: kokiy.thickshell.ThickShell, dict

A ThickShell that keeps dict behavior.

Use ThickShell instead.

Deprecated since version 0.2.0: Use ThickShell instead.

Methods

__init__(*args, **kwargs)

bake_from_shell(shell, width_points[, ...])

clear()

copy()

dump([filename, fields])

Dump shell geometrical and physical properties into hdf file.

dump_shell([name, fields])

Dump shell geometrical properties into hdf file.

export_geo(filename[, show_all])

Exports simplified boundary representation for visualization.

export_mesh(filename, elem_type, **kwargs)

Exports mesh.

fromkeys([value])

Create a new dictionary with keys from iterable and values set to value.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

get_mesh(elem_type)

Returns a yamio.Mesh.

items()

keys()

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised

popitem()

Remove and return a (key, value) pair as a 2-tuple.

replicate(shape)

Creates a similar instance, but possibly with different shape.

set_mask_on_shell(point_cloud, tol)

Create a mask on the shell from a point cloud.

setdefault(key[, default])

Insert key with a value of default if key is not in the dictionary.

update([E, ]**F)

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

values()

Attributes

dz

z-direction spacing matrix of shape self.shape.

geom_type

xyz

xyz matrix of shape (*self.shape, 3).

Methods

CakeDict.__init__(*args, **kwargs)[source]
classmethod CakeDict.bake_from_shell(shell, width_points, n_layers=1, shift=0.0)[source]
CakeDict.clear() None.  Remove all items from D.
CakeDict.copy() a shallow copy of D
CakeDict.dump(filename='shell', fields=None)[source]

Dump shell geometrical and physical properties into hdf file.

Parameters
  • filename (str) – Name of the file to dump.

  • fields (dict) – Additional fields to dump. (key, np.array).

CakeDict.dump_shell(name='shell', fields=None)

Dump shell geometrical properties into hdf file.

Parameters
  • name (str) – Name of the file to dump. Default ‘shell’.

  • fields (dict) – Additional fields to dump. (key, np.array).

Deprecated since version 0.2.0: Use dump instead.

CakeDict.export_geo(filename, show_all=False, **kwargs)

Exports simplified boundary representation for visualization.

Uses ensight gold format.

Parameters
  • show_all (bool) – Show all boundary edges?

  • kwargs – will be passed to writer.write method.

Notes

If goal is to proper export original mesh use export_mesh.

CakeDict.export_mesh(filename, elem_type, **kwargs)

Exports mesh.

Parameters
  • filename (str) – file name. Extension guides file type (any acceptable by yamio).

  • elem_type (str) – ‘tri’, ‘quad’, ‘tetra’, ‘hexahedron’.

  • kwargs – will be passed to writer.write method.

Notes

hip does not allow 3d surface meshes.

CakeDict.fromkeys(value=None, /)

Create a new dictionary with keys from iterable and values set to value.

CakeDict.get(key, default=None, /)

Return the value for key if key is in the dictionary, else default.

CakeDict.get_mesh(elem_type)

Returns a yamio.Mesh.

CakeDict.items() a set-like object providing a view on D's items
CakeDict.keys() a set-like object providing a view on D's keys
CakeDict.pop(k[, d]) v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised

CakeDict.popitem()

Remove and return a (key, value) pair as a 2-tuple.

Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.

CakeDict.replicate(shape)[source]

Creates a similar instance, but possibly with different shape.

CakeDict.set_mask_on_shell(point_cloud, tol)

Create a mask on the shell from a point cloud.

Parameters
  • point_cloud (numpy.ndarray) – Coordinates with shape (n, 3).

  • tol (float) – Tolerance.

Notes

The mask value is 0 for shell points located near cloud points. Otherwise the mask value is 1.

CakeDict.setdefault(key, default=None, /)

Insert key with a value of default if key is not in the dictionary.

Return the value for key if key is in the dictionary, else default.

CakeDict.update([E, ]**F) None.  Update D from dict/iterable E and F.

If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]

CakeDict.values() an object providing a view on D's values