flowmachine.core.server.query_schemas.meaningful_locations¶
Class MeaningfulLocationsAggregateExposed¶
MeaningfulLocationsAggregateExposed(*, start_date: str, end_date: str, aggregation_unit: Union[flowmachine.core.spatial_unit.CellSpatialUnit, flowmachine.core.spatial_unit.GeomSpatialUnit], label: str, labels: Dict[str, Dict[str, dict]], tower_day_of_week_scores: Dict[str, float], tower_hour_of_day_scores: List[float], tower_cluster_radius: float = 1.0, tower_cluster_call_threshold: int = 0, event_types: Union[str, List[str], NoneType], subscriber_subset: Union[dict, NoneType] = None)
Base class for exposed flowmachine queries. Note: this class and derived classes are not meant to be instantiated directly! Instead, they are instantiated automatically by the class FlowmachineQuerySchema. Example: FlowmachineQuerySchema().load({"query_kind": "dummy_query", "dummy_param": "foobar"})
Attributes¶
Methods¶
_flowmachine_query_obj¶
_flowmachine_query_obj
Return the underlying flowmachine MeaningfulLocationsAggregate object.
Returns¶
ModalLocation
query_id¶
query_id
Class MeaningfulLocationsAggregateSchema¶
MeaningfulLocationsAggregateSchema(*, only: Union[Sequence[str], Set[str], NoneType] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Union[Dict, NoneType] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Union[str, NoneType] = None)
Base schema class with which to define custom schemas.
Example usage: .. code-block:: python import datetime as dt from dataclasses import dataclass from marshmallow import Schema, fields @dataclass class Album: title: str release_date: dt.date class AlbumSchema(Schema): title = fields.Str() release_date = fields.Date() album = Album("Beggars Banquet", dt.date(1968, 12, 6)) schema = AlbumSchema() data = schema.dump(album) data # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'} :param only: Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters. :param exclude: Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only
and exclude
, it is not used. Nested fields can be represented with dot delimiters. :param many: Should be set to True
if obj
is a collection so that the object will be serialized to a list. :param context: Optional context passed to :class:fields.Method
and :class:fields.Function
fields. :param load_only: Fields to skip during serialization (write-only fields) :param dump_only: Fields to skip during deserialization (read-only fields) :param partial: Whether to ignore missing fields and not require any fields declared. Propagates down to Nested
fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields. :param unknown: Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE
, INCLUDE
or RAISE
. .. versionchanged:: 3.0.0 prefix
parameter removed. .. versionchanged:: 2.0.0 __validators__
, __preprocessors__
, and __data_handlers__
are removed in favor of marshmallow.decorators.validates_schema
, marshmallow.decorators.pre_load
and marshmallow.decorators.post_dump
. __accessor__
and __error_handler__
are deprecated. Implement the handle_error
and get_attribute
methods instead.
Attributes¶
Methods¶
dict_class¶
dict_class
set_class¶
set_class
Class MeaningfulLocationsBetweenDatesODMatrixExposed¶
MeaningfulLocationsBetweenDatesODMatrixExposed(*, start_date_a: str, end_date_a: str, start_date_b: str, end_date_b: str, aggregation_unit: Union[flowmachine.core.spatial_unit.CellSpatialUnit, flowmachine.core.spatial_unit.GeomSpatialUnit], label: str, labels: Dict[str, Dict[str, dict]], tower_day_of_week_scores: Dict[str, float], tower_hour_of_day_scores: List[float], tower_cluster_radius: float = 1.0, tower_cluster_call_threshold: int = 0, event_types: Union[str, List[str], NoneType], subscriber_subset: Union[dict, NoneType] = None)
Base class for exposed flowmachine queries. Note: this class and derived classes are not meant to be instantiated directly! Instead, they are instantiated automatically by the class FlowmachineQuerySchema. Example: FlowmachineQuerySchema().load({"query_kind": "dummy_query", "dummy_param": "foobar"})
Attributes¶
Methods¶
_flowmachine_query_obj¶
_flowmachine_query_obj
Return the underlying flowmachine MeaningfulLocationsAggregate object.
Returns¶
MeaningfulLocationsOD
query_id¶
query_id
Class MeaningfulLocationsBetweenDatesODMatrixSchema¶
MeaningfulLocationsBetweenDatesODMatrixSchema(*, only: Union[Sequence[str], Set[str], NoneType] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Union[Dict, NoneType] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Union[str, NoneType] = None)
Base schema class with which to define custom schemas.
Example usage: .. code-block:: python import datetime as dt from dataclasses import dataclass from marshmallow import Schema, fields @dataclass class Album: title: str release_date: dt.date class AlbumSchema(Schema): title = fields.Str() release_date = fields.Date() album = Album("Beggars Banquet", dt.date(1968, 12, 6)) schema = AlbumSchema() data = schema.dump(album) data # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'} :param only: Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters. :param exclude: Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only
and exclude
, it is not used. Nested fields can be represented with dot delimiters. :param many: Should be set to True
if obj
is a collection so that the object will be serialized to a list. :param context: Optional context passed to :class:fields.Method
and :class:fields.Function
fields. :param load_only: Fields to skip during serialization (write-only fields) :param dump_only: Fields to skip during deserialization (read-only fields) :param partial: Whether to ignore missing fields and not require any fields declared. Propagates down to Nested
fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields. :param unknown: Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE
, INCLUDE
or RAISE
. .. versionchanged:: 3.0.0 prefix
parameter removed. .. versionchanged:: 2.0.0 __validators__
, __preprocessors__
, and __data_handlers__
are removed in favor of marshmallow.decorators.validates_schema
, marshmallow.decorators.pre_load
and marshmallow.decorators.post_dump
. __accessor__
and __error_handler__
are deprecated. Implement the handle_error
and get_attribute
methods instead.
Attributes¶
Methods¶
dict_class¶
dict_class
set_class¶
set_class
Class MeaningfulLocationsBetweenLabelODMatrixExposed¶
MeaningfulLocationsBetweenLabelODMatrixExposed(*, start_date: str, end_date: str, aggregation_unit: Union[flowmachine.core.spatial_unit.CellSpatialUnit, flowmachine.core.spatial_unit.GeomSpatialUnit], label_a: str, label_b: str, labels: Dict[str, Dict[str, dict]], tower_day_of_week_scores: Dict[str, float], tower_hour_of_day_scores: List[float], tower_cluster_radius: float = 1.0, tower_cluster_call_threshold: int = 0, event_types: Union[str, List[str], NoneType], subscriber_subset: Union[dict, NoneType] = None)
Base class for exposed flowmachine queries. Note: this class and derived classes are not meant to be instantiated directly! Instead, they are instantiated automatically by the class FlowmachineQuerySchema. Example: FlowmachineQuerySchema().load({"query_kind": "dummy_query", "dummy_param": "foobar"})
Attributes¶
Methods¶
_flowmachine_query_obj¶
_flowmachine_query_obj
Return the underlying flowmachine MeaningfulLocationsAggregate object.
Returns¶
MeaningfulLocationsOD
query_id¶
query_id
Class MeaningfulLocationsBetweenLabelODMatrixSchema¶
MeaningfulLocationsBetweenLabelODMatrixSchema(*, only: Union[Sequence[str], Set[str], NoneType] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Union[Dict, NoneType] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: Union[str, NoneType] = None)
Base schema class with which to define custom schemas.
Example usage: .. code-block:: python import datetime as dt from dataclasses import dataclass from marshmallow import Schema, fields @dataclass class Album: title: str release_date: dt.date class AlbumSchema(Schema): title = fields.Str() release_date = fields.Date() album = Album("Beggars Banquet", dt.date(1968, 12, 6)) schema = AlbumSchema() data = schema.dump(album) data # {'release_date': '1968-12-06', 'title': 'Beggars Banquet'} :param only: Whitelist of the declared fields to select when instantiating the Schema. If None, all fields are used. Nested fields can be represented with dot delimiters. :param exclude: Blacklist of the declared fields to exclude when instantiating the Schema. If a field appears in both only
and exclude
, it is not used. Nested fields can be represented with dot delimiters. :param many: Should be set to True
if obj
is a collection so that the object will be serialized to a list. :param context: Optional context passed to :class:fields.Method
and :class:fields.Function
fields. :param load_only: Fields to skip during serialization (write-only fields) :param dump_only: Fields to skip during deserialization (read-only fields) :param partial: Whether to ignore missing fields and not require any fields declared. Propagates down to Nested
fields as well. If its value is an iterable, only missing fields listed in that iterable will be ignored. Use dot delimiters to specify nested fields. :param unknown: Whether to exclude, include, or raise an error for unknown fields in the data. Use EXCLUDE
, INCLUDE
or RAISE
. .. versionchanged:: 3.0.0 prefix
parameter removed. .. versionchanged:: 2.0.0 __validators__
, __preprocessors__
, and __data_handlers__
are removed in favor of marshmallow.decorators.validates_schema
, marshmallow.decorators.pre_load
and marshmallow.decorators.post_dump
. __accessor__
and __error_handler__
are deprecated. Implement the handle_error
and get_attribute
methods instead.
Attributes¶
Methods¶
dict_class¶
dict_class
set_class¶
set_class