Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
add remove_platform option for generate_and_store_maps
Browse files Browse the repository at this point in the history
  • Loading branch information
hroberts committed Sep 26, 2020
1 parent 22baefb commit bf74724
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/topics-map/src/python/topics_map/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,9 +759,17 @@ def store_map(db: DatabaseHandler,
db.update_by_id('timespan_maps', timespan_map['timespan_maps_id'], {'url': url})


def generate_and_store_maps(db: DatabaseHandler, timespans_id: int, memory_limit_mb: int) -> None:
def generate_and_store_maps(
db: DatabaseHandler,
timespans_id: int,
memory_limit_mb: int,
remove_platforms: bool = True) -> None:
"""Generate and layout graph and store various formats of the graph in timespans_maps."""
graph = generate_and_layout_graph(db=db, timespans_id=timespans_id, memory_limit_mb=memory_limit_mb)
graph = generate_and_layout_graph(
db=db,
timespans_id=timespans_id,
memory_limit_mb=memory_limit_mb,
remove_platforms=remove_platforms)

for color_by in ('community', 'retweet_partisanship', 'twitter_partisanship'):
assign_colors(db=db, graph=graph, color_by=color_by)
Expand Down

0 comments on commit bf74724

Please sign in to comment.