Other Classes

ProjectElement

Available elements are PointSet, LineSet, Surface, and Volume; Project are built with elements.

class omf.base.ProjectElement(**kwargs)[source]

Base ProjectElement class for OMF file

ProjectElement subclasses must define their geometric definition. ProjectElements include PointSet, LineSet, Surface, and Volume

Required Properties:

  • description (String): Description of the object, a unicode string
  • metadata (ArbitraryMetadataDict): Element metadata, an arbitrary JSON-serializable dictionary, with certain keys validated against ElementMetadata
  • name (String): Title of the object, a unicode string
  • uid (String): Unique identifier, a unicode string, Default: new instance of unicode

Optional Properties:

  • data (a list of ProjectElementData): Data defined on the element, a list (each item is an instance of ProjectElementData)

ProjectElement Data

class omf.base.ProjectElementData(**kwargs)[source]

Data array with values at specific locations on the mesh

Required Properties:

  • description (String): Description of the object, a unicode string
  • location (StringChoice): Location of the data on mesh, any of “vertices”, “segments”, “faces”, “cells”, “elements”
  • metadata (ArbitraryMetadataDict): Attribute metadata, an arbitrary JSON-serializable dictionary, with certain keys validated against AttributeMetadata
  • name (String): Title of the object, a unicode string
  • uid (String): Unique identifier, a unicode string, Default: new instance of unicode

Content Model

class omf.base.ContentModel(**kwargs)[source]

ContentModel is a UidModel with name, description, and metadata

Required Properties:

  • description (String): Description of the object, a unicode string
  • metadata (ArbitraryMetadataDict): Basic object metadata, an arbitrary JSON-serializable dictionary, with certain keys validated against BaseMetadata
  • name (String): Title of the object, a unicode string
  • uid (String): Unique identifier, a unicode string, Default: new instance of unicode

Uid Model

UidModel gives all content a name, description, and unique uid.

class omf.base.UidModel(**kwargs)[source]

UidModel is a HasProperties object with uid

Required Properties:

  • uid (String): Unique identifier, a unicode string, Default: new instance of unicode

Metadata Classes

class omf.base.ProjectMetadata(**kwargs)[source]

Validated metadata properties for Projects

Optional Properties:

  • author (String): Author of the project, a unicode string
  • coordinate_reference_system (String): EPSG or Proj4 plus optional local transformation string, a unicode string
  • date (StringDateTime): Date associated with the project data, a datetime object
  • date_created (StringDateTime): Date object was created, a datetime object
  • date_modified (StringDateTime): Date object was modified, a datetime object
  • revision (String): Revision, a unicode string
class omf.base.ElementMetadata(**kwargs)[source]

Validated metadata properties for Elements

Optional Properties:

  • color (Color): Solid element color, a color
  • coordinate_reference_system (String): EPSG or Proj4 plus optional local transformation string, a unicode string
  • date_created (StringDateTime): Date object was created, a datetime object
  • date_modified (StringDateTime): Date object was modified, a datetime object
  • opacity (Float): Element opacity, a float in range [0, 1]
class omf.base.AttributeMetadata(**kwargs)[source]

Validated metadata properties for Attributes

Optional Properties:

  • date_created (StringDateTime): Date object was created, a datetime object
  • date_modified (StringDateTime): Date object was modified, a datetime object
  • units (String): Units of attribute values, a unicode string
class omf.base.BaseMetadata(**kwargs)[source]

Validated metadata properties for all objects

Optional Properties:

  • date_created (StringDateTime): Date object was created, a datetime object
  • date_modified (StringDateTime): Date object was modified, a datetime object
class omf.base.ArbitraryMetadataDict(doc, metadata_class, **kwargs)[source]

Custom property class for metadata dictionaries

This property accepts JSON-compatible dictionary with any arbitrary fields. However, an additional metadata_class is specified to validate specific fields.

class omf.base.StringDateTime(doc, **kwargs)[source]

DateTime property validated to be a string