PyOpenWorm.datasource module¶
-
class
PyOpenWorm.datasource.BaseDataTranslator[source]¶ Bases:
PyOpenWorm.dataObject.BaseDataObjectTranslates from a data source to PyOpenWorm objects
-
input_type¶ alias of
DataSource
-
output_type¶ alias of
DataSource
-
translation_type¶ alias of
Translation
-
make_translation(sources=())[source]¶ It’s intended that implementations of DataTranslator will override this method to make custom Translations according with how different arguments to Translate are (or are not) distinguished.
The actual properties of a Translation subclass must be defined within the ‘translate’ method
-
-
class
PyOpenWorm.datasource.DataObjectContextDataSource(context, **kwargs)[source]¶ Bases:
PyOpenWorm.datasource.DataSource- Description :
DatatypeProperty Attribute: description
Free-text describing the data source
- Input source :
ObjectProperty Attribute: source
The data source that was translated into this one
- Translation :
ObjectProperty Attribute: translation
Information about the translation process that created this object
- Description :
-
class
PyOpenWorm.datasource.DataSource(**kwargs)[source]¶ Bases:
PyOpenWorm.dataObject.BaseDataObjectA source for data that can get translated into PyOpenWorm objects.
The value for any field can be passed to __init__ by name. Additionally, if the sub-class definition of a DataSource assigns a value for that field like:
class A(DataSource): some_field = 3
that value will be used over the default value for the field, but not over any value provided to __init__.
-
defined_augment()[source]¶ This fuction must return False if
identifier_augment()would raise anIdentifierMissingException. Override it when defining a non-standard identifier for subclasses of DataObjects.
-
identifier_augment()[source]¶ Override this method to define an identifier in lieu of one explicity set.
One must also override
defined_augment()to return True whenever this method could return a valid identifier.IdentifierMissingExceptionshould be raised if an identifier cannot be generated by this method.Raises: - IdentifierMissingException
-
-
class
PyOpenWorm.datasource.DataSourceType(name, bases, dct)[source]¶ Bases:
PyOpenWorm.dataObject.ContextMappedClassA type for DataSources
Sets up the graph with things needed for MappedClasses
-
class
PyOpenWorm.datasource.DataTranslator[source]¶ Bases:
PyOpenWorm.datasource.BaseDataTranslatorA specialization with the GenericTranslation translation type that adds sources for the translation automatically when a new output is made
-
translation_type¶ alias of
GenericTranslation
-
make_translation(sources=())[source]¶ It’s intended that implementations of DataTranslator will override this method to make custom Translations according with how different arguments to Translate are (or are not) distinguished.
The actual properties of a Translation subclass must be defined within the ‘translate’ method
-
-
class
PyOpenWorm.datasource.GenericTranslation(source=None, **kwargs)[source]¶ Bases:
PyOpenWorm.datasource.TranslationA generic translation that just has sources in order
-
defined_augment()[source]¶ This fuction must return False if
identifier_augment()would raise anIdentifierMissingException. Override it when defining a non-standard identifier for subclasses of DataObjects.
-
identifier_augment()[source]¶ Override this method to define an identifier in lieu of one explicity set.
One must also override
defined_augment()to return True whenever this method could return a valid identifier.IdentifierMissingExceptionshould be raised if an identifier cannot be generated by this method.Raises: - IdentifierMissingException
-
-
class
PyOpenWorm.datasource.PersonDataTranslator(person)[source]¶ Bases:
PyOpenWorm.datasource.BaseDataTranslatorA person who was responsible for carrying out the translation of a data source
-
class
PyOpenWorm.datasource.Translation(translator=None, **kwargs)[source]¶ Bases:
PyOpenWorm.dataObject.BaseDataObjectRepresentation of the method by which a DataSource was translated and the sources of that translation. Unlike the ‘source’ field attached to DataSources, the Translation may distinguish different kinds of input source to a translation.
-
defined_augment()[source]¶ This fuction must return False if
identifier_augment()would raise anIdentifierMissingException. Override it when defining a non-standard identifier for subclasses of DataObjects.
-
identifier_augment()[source]¶ Override this method to define an identifier in lieu of one explicity set.
One must also override
defined_augment()to return True whenever this method could return a valid identifier.IdentifierMissingExceptionshould be raised if an identifier cannot be generated by this method.Raises: - IdentifierMissingException
-