from wikiCat.wikiproject import Project
To create a new default project you need to pass init=True when calling Project(). If no project_path is provided, the project is created in the default path. Optionally you can set the project_path, project_info, title, description and dump_date.
mp = Project(init=True)
To load an existing project. If no path is passed the script assumes that the project is located in the default path. In case you create a project in a non default path you need to pass the project_path. If this location is not correct you will get an error message.
mp = Project()
Adding parsed data to an existing project requires:
mp.add_parsed_data(page_info='page_info.csv',
revision_info='revisions.csv',
cat_data='cats.csv',
description='Some description about the data.')
mp.add_graph_data('cat_data_fixed_none_errors_removed_1_nodes.csv', 'cat_data_fixed_none_errors_removed_1_edges.csv', 'cat_data_fixed_none_errors_removed_1_events.csv')
mp.add_gt_graph('gt_graph.gt', 'gt_nodes_graph.csv')
mp.generate_graph_data(data_type='cats')
mp.find_errors_in_parsed()
mp.find_start_date()
mp.calculate_cscores()
mp.generate_gt_graph()
mp.graph
mp.graph.list_graphs()
mp.graph.set_working_graph('main')
mp.graph.get_working_graph()
#mp.graph.set_working_graph('main')
mp.create_subgraph(title='Simulation_1_sub_1_super_gt', seed=[7744777], cats=True,
subcats=1, supercats=1)
mp.create_snapshots(graph='Simulation_1_sub_1_super_gt', title='snapshots_year',
start_date='2003-01-10')
mp.remove_snapshots(subgraph='Simulation_1_sub_1_super_gt', title='Simulation_1_sub_1_super_gt')
mp.remove_subgraph(subgraph= ...) #untested
mp.create_static_viz('Simulation_1_sub_1_super_gt', 'ARF', snapshots='snapshots_year', drawing_props_file='static.json')
mp.create_static_viz('Simulation_1_sub_1_super_gt', 'SFDP', snapshots='snapshots_year', drawing_props_file='static.json')
mp.create_static_viz('Simulation_1_sub_1_super_gt', 'RTL', snapshots='snapshots_year', drawing_props_file='static.json', seed=7744777)