Skip to content

Commit aaf8250

Browse files
committed
Merge branch 'master' into asyncio
2 parents a68b551 + 88e605b commit aaf8250

File tree

15 files changed

+232
-71
lines changed

15 files changed

+232
-71
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
88

99
### Added
1010
- Previously run, or currently running queries can now be referenced as a subscriber subset via FlowAPI. [#1009](https://github.com/Flowminder/FlowKit/issues/1009)
11+
- total_network_objects, location_introversion, and unique_subscriber_counts now also accept subscriber subsets.
1112

1213
### Changed
1314
- `get_cached_query_objects_ordered_by_score` is now a generator. [#3116](https://github.com/Flowminder/FlowKit/issues/3116)

flowauth/frontend/package-lock.json

Lines changed: 25 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flowauth/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"date-fns": "^2.16.1",
1111
"generate-password": "^1.5.1",
1212
"react": "^16.14.0",
13-
"react-dom": "^16.13.1",
13+
"react-dom": "^16.14.0",
1414
"react-qr-svg": "^2.2.2",
1515
"react-scripts": "^3.4.3",
16-
"rsuite": "^4.8.1",
16+
"rsuite": "^4.8.4",
1717
"zxcvbn": "^4.4.2",
1818
"classnames": "^2.2.6"
1919
},

flowclient/flowclient/aggregates.py

Lines changed: 49 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def location_event_counts_spec(
1919
count_interval: str,
2020
direction: str = "both",
2121
event_types: Optional[List[str]] = None,
22-
subscriber_subset: Union[dict, None] = None,
22+
subscriber_subset: Optional[Union[dict, str]] = None,
2323
mapping_table: Optional[str] = None,
2424
geom_table: Optional[str] = None,
2525
geom_table_join_column: Optional[str] = None,
@@ -116,7 +116,7 @@ def meaningful_locations_aggregate_spec(
116116
tower_cluster_radius: float = 1.0,
117117
tower_cluster_call_threshold: int = 0,
118118
event_types: Optional[List[str]] = None,
119-
subscriber_subset: Union[dict, None] = None,
119+
subscriber_subset: Optional[Union[dict, str]] = None,
120120
mapping_table: Optional[str] = None,
121121
geom_table: Optional[str] = None,
122122
geom_table_join_column: Optional[str] = None,
@@ -175,8 +175,8 @@ def meaningful_locations_aggregate_spec(
175175
If None, include all event types in the query.
176176
subscriber_subset : dict or None
177177
Subset of subscribers to retrieve modal locations for. Must be None
178-
(= all subscribers) or a dictionary with the specification of a
179-
subset query.
178+
(= all subscribers), a dictionary with the specification of a
179+
subset query, or a string which is a valid query id.
180180
181181
Returns
182182
-------
@@ -269,8 +269,8 @@ def meaningful_locations_aggregate(*, connection: Connection, **kwargs) -> APIQu
269269
If None, include all event types in the query.
270270
subscriber_subset : dict or None
271271
Subset of subscribers to retrieve modal locations for. Must be None
272-
(= all subscribers) or a dictionary with the specification of a
273-
subset query.
272+
(= all subscribers), a dictionary with the specification of a
273+
subset query, or a string which is a valid query id.
274274
275275
Returns
276276
-------
@@ -304,7 +304,7 @@ def meaningful_locations_between_label_od_matrix_spec(
304304
tower_cluster_radius: float = 1.0,
305305
tower_cluster_call_threshold: int = 0,
306306
event_types: Optional[List[str]] = None,
307-
subscriber_subset: Union[dict, None] = None,
307+
subscriber_subset: Optional[Union[dict, str]] = None,
308308
mapping_table: Optional[str] = None,
309309
geom_table: Optional[str] = None,
310310
geom_table_join_column: Optional[str] = None,
@@ -363,8 +363,8 @@ def meaningful_locations_between_label_od_matrix_spec(
363363
If None, include all event types in the query.
364364
subscriber_subset : dict or None
365365
Subset of subscribers to retrieve modal locations for. Must be None
366-
(= all subscribers) or a dictionary with the specification of a
367-
subset query.
366+
(= all subscribers), a dictionary with the specification of a
367+
subset query, or a string which is a valid query id.
368368
369369
Returns
370370
-------
@@ -460,8 +460,8 @@ def meaningful_locations_between_label_od_matrix(
460460
If None, include all event types in the query.
461461
subscriber_subset : dict or None
462462
Subset of subscribers to retrieve modal locations for. Must be None
463-
(= all subscribers) or a dictionary with the specification of a
464-
subset query.
463+
(= all subscribers), a dictionary with the specification of a
464+
subset query, or a string which is a valid query id.
465465
466466
Returns
467467
-------
@@ -496,7 +496,7 @@ def meaningful_locations_between_dates_od_matrix_spec(
496496
tower_cluster_radius: float = 1.0,
497497
tower_cluster_call_threshold: float = 0,
498498
event_types: Optional[List[str]] = None,
499-
subscriber_subset: Union[dict, None] = None,
499+
subscriber_subset: Optional[Union[dict, str]] = None,
500500
mapping_table: Optional[str] = None,
501501
geom_table: Optional[str] = None,
502502
geom_table_join_column: Optional[str] = None,
@@ -560,8 +560,8 @@ def meaningful_locations_between_dates_od_matrix_spec(
560560
If None, include all event types in the query.
561561
subscriber_subset : dict or None
562562
Subset of subscribers to retrieve modal locations for. Must be None
563-
(= all subscribers) or a dictionary with the specification of a
564-
subset query.
563+
(= all subscribers), a dictionary with the specification of a
564+
subset query, or a string which is a valid query id.
565565
566566
Returns
567567
-------
@@ -662,9 +662,9 @@ def meaningful_locations_between_dates_od_matrix(
662662
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
663663
If None, include all event types in the query.
664664
subscriber_subset : dict or None
665-
Subset of subscribers to retrieve modal locations for. Must be None
666-
(= all subscribers) or a dictionary with the specification of a
667-
subset query.
665+
Subset of subscribers to retrieve values for. Must be None
666+
(= all subscribers), a dictionary with the specification of a
667+
subset query, or a string which is a valid query id.
668668
669669
Returns
670670
-------
@@ -745,6 +745,7 @@ def unique_subscriber_counts_spec(
745745
geom_table: Optional[str] = None,
746746
geom_table_join_column: Optional[str] = None,
747747
event_types: Optional[List[str]] = None,
748+
subscriber_subset: Optional[Union[dict, str]] = None,
748749
) -> dict:
749750
"""
750751
Return query spec for unique subscriber counts
@@ -760,6 +761,10 @@ def unique_subscriber_counts_spec(
760761
event_types : list of {"calls", "sms", "mds", "topups"}, optional
761762
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
762763
If None, include all event types in the query.
764+
subscriber_subset : dict or None
765+
Subset of subscribers to retrieve values for. Must be None
766+
(= all subscribers), a dictionary with the specification of a
767+
subset query, or a string which is a valid query id.
763768
764769
Returns
765770
-------
@@ -775,6 +780,7 @@ def unique_subscriber_counts_spec(
775780
"geom_table": geom_table,
776781
"geom_table_join_column": geom_table_join_column,
777782
"event_types": event_types,
783+
"subscriber_subset": subscriber_subset,
778784
}
779785

780786

@@ -796,6 +802,10 @@ def unique_subscriber_counts(*, connection: Connection, **kwargs) -> APIQuery:
796802
event_types : list of {"calls", "sms", "mds", "topups"}, optional
797803
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
798804
If None, include all event types in the query.
805+
subscriber_subset : dict or None
806+
Subset of subscribers to retrieve values for. Must be None
807+
(= all subscribers), a dictionary with the specification of a
808+
subset query, or a string which is a valid query id.
799809
800810
Returns
801811
-------
@@ -815,6 +825,7 @@ def location_introversion_spec(
815825
geom_table: Optional[str] = None,
816826
geom_table_join_column: Optional[str] = None,
817827
event_types: Optional[List[str]] = None,
828+
subscriber_subset: Optional[Union[dict, str]] = None,
818829
) -> dict:
819830
"""
820831
Return query spec for location introversion
@@ -832,6 +843,10 @@ def location_introversion_spec(
832843
event_types : list of {"calls", "sms", "mds", "topups"}, optional
833844
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
834845
If None, include all event types in the query.
846+
subscriber_subset : dict or None
847+
Subset of subscribers to retrieve values for. Must be None
848+
(= all subscribers), a dictionary with the specification of a
849+
subset query, or a string which is a valid query id.
835850
836851
Returns
837852
-------
@@ -848,6 +863,7 @@ def location_introversion_spec(
848863
"geom_table": geom_table,
849864
"geom_table_join_column": geom_table_join_column,
850865
"event_types": event_types,
866+
"subscriber_subset": subscriber_subset,
851867
}
852868

853869

@@ -871,6 +887,10 @@ def location_introversion(*, connection: Connection, **kwargs) -> APIQuery:
871887
event_types : list of {"calls", "sms", "mds", "topups"}, optional
872888
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
873889
If None, include all event types in the query.
890+
subscriber_subset : dict or None
891+
Subset of subscribers to retrieve values for. Must be None
892+
(= all subscribers), a dictionary with the specification of a
893+
subset query, or a string which is a valid query id.
874894
875895
Returns
876896
-------
@@ -890,6 +910,7 @@ def total_network_objects_spec(
890910
geom_table: Optional[str] = None,
891911
geom_table_join_column: Optional[str] = None,
892912
event_types: Optional[List[str]] = None,
913+
subscriber_subset: Optional[Union[dict, str]] = None,
893914
) -> dict:
894915
"""
895916
Return query spec for total network objects
@@ -907,6 +928,10 @@ def total_network_objects_spec(
907928
event_types : list of {"calls", "sms", "mds", "topups"}, optional
908929
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
909930
If None, include all event types in the query.
931+
subscriber_subset : dict or None
932+
Subset of subscribers to retrieve values for. Must be None
933+
(= all subscribers), a dictionary with the specification of a
934+
subset query, or a string which is a valid query id.
910935
911936
Returns
912937
-------
@@ -923,6 +948,7 @@ def total_network_objects_spec(
923948
"geom_table": geom_table,
924949
"geom_table_join_column": geom_table_join_column,
925950
"event_types": event_types,
951+
"subscriber_subset": subscriber_subset,
926952
}
927953

928954

@@ -946,6 +972,10 @@ def total_network_objects(*, connection: Connection, **kwargs) -> APIQuery:
946972
event_types : list of {"calls", "sms", "mds", "topups"}, optional
947973
Optionally, include only a subset of event types (for example: ["calls", "sms"]).
948974
If None, include all event types in the query.
975+
subscriber_subset : dict or None
976+
Subset of subscribers to retrieve values for. Must be None
977+
(= all subscribers), a dictionary with the specification of a
978+
subset query, or a string which is a valid query id.
949979
950980
Returns
951981
-------
@@ -1054,7 +1084,7 @@ def consecutive_trips_od_matrix_spec(
10541084
end_date: str,
10551085
aggregation_unit: str,
10561086
event_types: Optional[List[str]] = None,
1057-
subscriber_subset: Union[dict, None] = None,
1087+
subscriber_subset: Optional[Union[dict, str]] = None,
10581088
mapping_table: Optional[str] = None,
10591089
geom_table: Optional[str] = None,
10601090
geom_table_join_column: Optional[str] = None,
@@ -1132,7 +1162,7 @@ def trips_od_matrix_spec(
11321162
end_date: str,
11331163
aggregation_unit: str,
11341164
event_types: Optional[List[str]] = None,
1135-
subscriber_subset: Union[dict, None] = None,
1165+
subscriber_subset: Optional[Union[dict, str]] = None,
11361166
mapping_table: Optional[str] = None,
11371167
geom_table: Optional[str] = None,
11381168
geom_table_join_column: Optional[str] = None,

0 commit comments

Comments
 (0)