randomdataset.fields package¶
Submodules¶
randomdataset.fields.basicfields module¶
-
class
randomdataset.fields.basicfields.ASCIIFieldGen(name: str, lmin=5, lmax=10, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.basicfields.StrFieldGen-
CHARS= [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127]¶
-
-
class
randomdataset.fields.basicfields.AlphaNameGen(name: str, is_first_name=True, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
first_names= ['Alice', 'Bob', 'Carol', 'Dan', 'Eve', 'Frank', 'Grace', 'Heidi', 'Ivan', 'Judy', 'Kylie', 'Laura', 'Mallory', 'Ned', 'Olivia', 'Peggy', 'Quin', 'Rupert', 'Sybil', 'Trudy', 'Uriel', 'Victor', 'Wendy', 'Xavier', 'Yan', 'Zoe']¶
-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
last_names= ['Anon', 'Random', 'None', 'Null', 'Blargs', 'Bloggs', 'Bar', 'Thunk', 'Nobody', 'Nemo', 'Unknown']¶
-
-
class
randomdataset.fields.basicfields.BoolFieldGen(name: str, as_string=False, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
-
class
randomdataset.fields.basicfields.DateTimeFieldGen(name: str, start_time: Optional[float] = None, end_time: Optional[float] = None, as_string: bool = False, rand_state: Optional[numpy.random.mtrand.RandomState] = None, ftimeformat: Optional[str] = None, timezone: Optional[datetime.timezone] = datetime.timezone.utc, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
-
class
randomdataset.fields.basicfields.FloatFieldGen(name: str, vmin: float = 0, vmax: float = 1.0, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
-
class
randomdataset.fields.basicfields.IntFieldGen(name: str, vmin: int = 0, vmax: int = 100, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
-
class
randomdataset.fields.basicfields.SetFieldGen(name: str, values: set, field_type: randomdataset.fields.fieldgen.FieldTypes, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
Bases:
randomdataset.fields.fieldgen.FieldGenCalled by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
class
randomdataset.fields.basicfields.StrFieldGen(name: str, lmin=5, lmax=10, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
CHARS= [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 48, 49, 50, 51, 52, 53, 54, 55, 56]¶
-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
-
class
randomdataset.fields.basicfields.UIDFieldGen(name: str, start_value: int = 0, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
randomdataset.fields.fieldgen.FieldGen-
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
randomdataset.fields.fieldgen module¶
-
class
randomdataset.fields.fieldgen.FieldGen(name: str, field_type: randomdataset.fields.fieldgen.FieldTypes, rand_state: Optional[numpy.random.mtrand.RandomState] = None, shared_state_name=None)¶ Bases:
abc.ABCBase class for generating field data. Inheriting classes will generate data corresponding to their field_type attribute, using the default random state R or the one passed through the constructor
- Args:
name: name of the field field_type: type of data produced by the generator, or np.ndarray structures thereof rand_state: random state to generate data from shared_state_name: if provided, data is stored in the dataset when generated for sharing with other fields
-
R: numpy.random.mtrand.RandomState = RandomState(MT19937) at 0x7F8E52C155A0¶
-
abstract
generate(shape: Optional[Tuple[int, …]] = None)¶ Called by __call__, generate a single datum if shape is None, otherwise array of data with that shape.
-
property
parent¶
-
class
randomdataset.fields.fieldgen.FieldTypes(value)¶ Bases:
enum.EnumData types produced by FieldGen objects.
-
BOOL= ('bool', <class 'bool'>)¶
-
FLOAT= ('float', <class 'float'>)¶
-
INTEGER= ('int', <class 'int'>)¶
-
STRDATETIME= ('datetime', <class 'str'>)¶
-
STRING= ('string', <class 'str'>)¶
-
-
randomdataset.fields.fieldgen.OptRandStateType¶ The central part of internal API.
This represents a generic version of type ‘origin’ with type arguments ‘params’. There are two kind of these aliases: user defined and special. The special ones are wrappers around builtin collections and ABCs in collections.abc. These must have ‘name’ always set. If ‘inst’ is False, then the alias can’t be instantiated, this is used by e.g. typing.List and typing.Dict.
alias of Optional[numpy.random.mtrand.RandomState]
-
randomdataset.fields.fieldgen.OptShapeType¶ The central part of internal API.
This represents a generic version of type ‘origin’ with type arguments ‘params’. There are two kind of these aliases: user defined and special. The special ones are wrappers around builtin collections and ABCs in collections.abc. These must have ‘name’ always set. If ‘inst’ is False, then the alias can’t be instantiated, this is used by e.g. typing.List and typing.Dict.
alias of Optional[Tuple[int, …]]