Type annotations for foreign procedures: module venture.lite.types¶
-
class
venture.lite.types.
AnyType
(type_name=None)¶ Bases:
venture.lite.types.VentureType
The type object to use for parametric types – does no conversion.
-
asPython
(thing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
venture.lite.types.
Array
(subtype=None)¶
-
class
venture.lite.types.
ArrayType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
ArrayUnboxedType
(subtype, name=None)¶ Bases:
venture.lite.types.VentureType
Type objects for arrays of unboxed values. Perforce homogeneous.
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
AtomType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
BoolType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
CountType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
venture.lite.types.
Dict
(keytype=None, valtype=None)¶
-
class
venture.lite.types.
DictType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
ExpressionType
(name=None)¶ Bases:
venture.lite.types.VentureType
A Venture expression is either a Venture self-evaluating object (bool, number, integer, atom), or a Venture symbol, or a Venture array of Venture Expressions. Note: I adopt the convention that, to distinguish them from numbers, Venture Atoms will be represented in Python as VentureAtom objects for purposes of this type.
Note 2: Consumers of expressions should also be able to consume lists of expressions, but the Python-side representation of expressions does not distinguish the representation of lists and arrays. So round-tripping from Venture to Python and back will not be the identity function, but should still be idempotent.
Note 3: The same discussion applies to other nice types like VentureSPRecords.
In Haskell type notation:
data Expression = Bool | Number | Integer | Atom | Symbol | Array Expression
-
asPython
(thing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
ForeignBlobType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
venture.lite.types.
HomogeneousArrayType
¶ alias of
venture.lite.types.ArrayUnboxedType
-
class
venture.lite.types.
HomogeneousDictType
(keytype, valtype, name=None)¶ Bases:
venture.lite.types.VentureType
Type objects for homogeneous dicts. Right now, the homogeneity is not captured in the implementation, in that on the Venture side such data is still stored as heterogenous Venture dicts. This type does, however, encapsulate the necessary wrapping and unwrapping.
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
HomogeneousListType
(subtype, name=None)¶ Bases:
venture.lite.types.VentureType
Type objects for homogeneous lists. Right now, the homogeneity is not captured in the implementation, in that on the Venture side such data is still stored as heterogenous Venture lists. This type does, however, encapsulate the necessary wrapping and unwrapping.
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
HomogeneousMappingType
(keytype, valtype, name=None)¶ Bases:
venture.lite.types.VentureType
Type objects for all Venture mappings. Dicts are the only fully generic mappings, but Venture also treats arrays and lists as mappings from integers to values, and environments as mappings from symbols to values. This type is purely advisory and does not do any conversion.
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
HomogeneousSequenceType
(subtype, name=None)¶ Bases:
venture.lite.types.VentureType
Type objects for homogeneous sequences of any persuasion (lists, arrays, vectors, simplexes). Right now, the homogeneity is not captured in the implementation, in that on the Venture side such data is still stored as heterogenous Venture arrays. This type is purely advisory and does not do any conversion.
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
IntegerType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
venture.lite.types.
List
(subtype=None)¶
-
class
venture.lite.types.
ListType
(name=None)¶ Bases:
venture.lite.types.VentureType
A Venture list is either a VentureNil or a VenturePair whose second field is a Venture list. I choose that the corresponding Python object is a list of VentureValue objects (this is consistent with the Any type doing no conversion).
In Haskell type notation:
data List = Nil | Pair Any List
-
asPython
(thing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
venture.lite.types.
Mapping
(keytype, valtype)¶
-
class
venture.lite.types.
MatrixType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
NilType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(_vthing)¶
-
asVentureValue
(_thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
NonpositiveType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
NumberType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
NumericArrayType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
venture.lite.types.
Pair
(first, second)¶
-
class
venture.lite.types.
PairType
(first_type=None, second_type=None, name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
class
venture.lite.types.
PositiveType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
ProbabilityType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
RecursiveSimpleDataType
(name=None)¶ Bases:
venture.lite.types.VentureType
In Haskell type notation:
- data RecursiveSimpleData = Bool | Number | Integer | String
- Array RecursiveSimpleData | Dict RecursiveSimpleData RecursiveSimpleDataa Venture value represented as itself
Caveat: - Python doesn’t like dict keys to be mutable, so this limits the
recursion possibilities.- Symbols and Lists are additionally mapped to strings and lists, respectively, even though this makes the Venture->Python map not injective.
- Atoms, however, are left alone as VentureAtom instances.
-
asPython
(thing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
class
venture.lite.types.
RequestType
(name='<request>')¶ Bases:
venture.lite.types.VentureType
A type object for Venture’s Requests. Requests are not Venture values in the strict sense, and reflection is not permitted on them. This type exists to permit requester PSPs to be wrapped in the TypedPSP wrapper.
-
asPython
(thing)¶
-
asVentureValue
(thing)¶
-
name
()¶
-
-
venture.lite.types.
Seq
(subtype)¶
-
class
venture.lite.types.
SimplexType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
StringType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
SymbolType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
class
venture.lite.types.
SymmetricMatrixType
(name=None)¶ Bases:
venture.lite.types.VentureType
-
asPython
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
name
()¶
-
-
venture.lite.types.
UArray
(subtype)¶
-
class
venture.lite.types.
VentureType
¶ Bases:
object
Base class of all Venture types.
See the “Types” section of doc/type-system.md.
-
asPython
(vthing)¶
-
asPythonNoneable
(vthing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
gradient_type
()¶ The type of the cotangent space of the space represented by this type.
-
toJSON
()¶
-
-
class
venture.lite.types.
ZeroType
(name=None)¶ Bases:
venture.lite.types.VentureType
A type object representing elements of the zero-dimensional vector space. This is needed only to serve as the gradient type of discrete types like BoolType.
-
asPython
(thing)¶
-
asVentureValue
(thing)¶
-
distribution
(base, **kwargs)¶
-
name
()¶
-
-
venture.lite.types.
standard_venture_type
(typename, gradient_typename=None, value_classname=None)¶