base
Classes:
Statement of equivalence between two things, potentially with some translation or parameterization, such that a base type can be written to. |
|
Metaclass for mapping base types to another format. |
|
Create a representation of a given Schema |
Functions:
|
Get the "inner" type of a model field, sans Optionals and Unions and the like |
- pydantic model Interface_Map[source]
Bases:
Autopilot_TypeStatement of equivalence between two things, potentially with some translation or parameterization, such that a base type can be written to.
Show JSON schema
{ "title": "Interface_Map", "description": "Statement of equivalence between two things, potentially with some\ntranslation or parameterization, such that a base type can be written\nto.", "type": "object", "properties": { "equals": { "title": "Equals" }, "args": { "title": "Args", "type": "array", "items": {} }, "kwargs": { "title": "Kwargs", "type": "object" } }, "required": [ "equals" ] }
- pydantic model Interface_Mapset[source]
Bases:
Autopilot_TypeMetaclass for mapping base types to another format.
Each field can be a Type (if it is instantiated without arguments, or can use the
Interface_Mapto specify them.The special types
groupandnodecorrespond toGroupandNodeclasses, for when a given interface needs to do something to create an abstract representation of a group or node in a schema’s hierarchy.Todo
This will need to be generalized, eg. NWB doesn’t need a mapping between types and objects, but mappings between annotated types and paths (eg. something within the /data/trial_data makes a behavioral series, etc).
Show JSON schema
{ "title": "Interface_Mapset", "description": "Metaclass for mapping base types to another format.\n\nEach field can be a Type (if it is instantiated without arguments, or\ncan use the :class:`.Interface_Map` to specify them.\n\nThe special types ``group`` and ``node`` correspond to\n:class:`~.data.modeling.base.Group` and :class:`~.data.modeling.base.Node`\nclasses, for when a given interface needs to do something to create an\nabstract representation of a group or node in a schema's hierarchy.\n\n.. todo::\n\n This will need to be generalized, eg. NWB doesn't need a mapping between types and objects,\n but mappings between annotated types and paths (eg. something within the `/data/trial_data` makes\n a behavioral series, etc).", "type": "object", "properties": { "bool": { "title": "Bool", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "int": { "title": "Int", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "float": { "title": "Float", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "str": { "title": "Str", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "bytes": { "title": "Bytes", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "datetime": { "title": "Datetime", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "group": { "title": "Group", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "node": { "title": "Node", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] } }, "required": [ "bool", "int", "float", "str", "datetime" ], "definitions": { "Interface_Map": { "title": "Interface_Map", "description": "Statement of equivalence between two things, potentially with some\ntranslation or parameterization, such that a base type can be written\nto.", "type": "object", "properties": { "equals": { "title": "Equals" }, "args": { "title": "Args", "type": "array", "items": {} }, "kwargs": { "title": "Kwargs", "type": "object" } }, "required": [ "equals" ] } } }
- Fields:
- field bool: Interface_Map | Type [Required]
- field int: Interface_Map | Type [Required]
- field float: Interface_Map | Type [Required]
- field str: Interface_Map | Type [Required]
- field bytes: Interface_Map | Type | None = None
- field datetime: Interface_Map | Type [Required]
- field group: Interface_Map | Type | None = None
- field node: Interface_Map | Type | None = None
- pydantic model Interface[source]
Bases:
Autopilot_TypeCreate a representation of a given Schema
Show JSON schema
{ "title": "Interface", "description": "Create a representation of a given Schema", "type": "object", "properties": { "map": { "$ref": "#/definitions/Interface_Mapset" }, "schema": { "$ref": "#/definitions/Schema" } }, "required": [ "map", "schema" ], "definitions": { "Interface_Map": { "title": "Interface_Map", "description": "Statement of equivalence between two things, potentially with some\ntranslation or parameterization, such that a base type can be written\nto.", "type": "object", "properties": { "equals": { "title": "Equals" }, "args": { "title": "Args", "type": "array", "items": {} }, "kwargs": { "title": "Kwargs", "type": "object" } }, "required": [ "equals" ] }, "Interface_Mapset": { "title": "Interface_Mapset", "description": "Metaclass for mapping base types to another format.\n\nEach field can be a Type (if it is instantiated without arguments, or\ncan use the :class:`.Interface_Map` to specify them.\n\nThe special types ``group`` and ``node`` correspond to\n:class:`~.data.modeling.base.Group` and :class:`~.data.modeling.base.Node`\nclasses, for when a given interface needs to do something to create an\nabstract representation of a group or node in a schema's hierarchy.\n\n.. todo::\n\n This will need to be generalized, eg. NWB doesn't need a mapping between types and objects,\n but mappings between annotated types and paths (eg. something within the `/data/trial_data` makes\n a behavioral series, etc).", "type": "object", "properties": { "bool": { "title": "Bool", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "int": { "title": "Int", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "float": { "title": "Float", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "str": { "title": "Str", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "bytes": { "title": "Bytes", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "datetime": { "title": "Datetime", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "group": { "title": "Group", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] }, "node": { "title": "Node", "anyOf": [ { "$ref": "#/definitions/Interface_Map" }, {} ] } }, "required": [ "bool", "int", "float", "str", "datetime" ] }, "Schema": { "title": "Schema", "description": "A special type of type intended to be a representation of an\nabstract structure/schema of data, rather than a live container of\ndata objects themselves. This class is used for constructing data containers,\ntranslating between formats, etc. rather than momentary data handling", "type": "object", "properties": {} } } }
- Fields:
- field map: Interface_Mapset [Required]