<jupyter_start><jupyter_text>Load the configuration file into an `OTMWrapper` object<jupyter_code># always check and delete old OTMWrapper objects
if "otmwrapper" in locals():
    del otmwrapper

# open the api
test_config = str(pathlib.Path().absolute().parent.joinpath('configs').joinpath('test_config.xml'))
otmwrapper = OTMWrapper(test_config)
otm = otmwrapper.otm

print(otm)<jupyter_output><empty_output><jupyter_text>Request outputs<jupyter_code>outdt = 5.0
prefix = "exp1"
start_time = 0.0
duration = 1000.0
output_folder = "output"
comm_id = None
link_ids = [2]
otm.output().clear()

# links
otm.output().request_links_flow(prefix,output_folder,comm_id,link_ids,outdt)
otm.output().request_links_veh(prefix,output_folder,comm_id,link_ids,outdt)

# lane groups
otm.output().request_lanegroups(prefix,output_folder)
otm.output().request_lanegroup_flw(prefix,output_folder,comm_id,link_ids,outdt)
otm.output().request_lanegroup_veh(prefix,output_folder,comm_id,link_ids,outdt)

# cells
otm.output().request_cell_flw(prefix,output_folder,comm_id,link_ids,outdt)
otm.output().request_cell_veh(prefix,output_folder,comm_id,link_ids,outdt)
otm.output().request_cell_lanechange_out(prefix,output_folder,comm_id,link_ids,outdt)
otm.output().request_cell_lanechange_in(prefix,output_folder,comm_id,link_ids,outdt)<jupyter_output><empty_output><jupyter_text>Run the simulation<jupyter_code>otm.run(prefix,None,output_folder,start_time,duration,True)<jupyter_output><empty_output><jupyter_text>Link flows<jupyter_code>cumflw, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'link', 'flw')
otmwrapper.lineplot(time[1:] , np.diff(cumflw,axis=0)*3600/(time[1]-time[0]) , cols, "Link flows [vph]")<jupyter_output><empty_output><jupyter_text>Link vehicles<jupyter_code>veh, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'link', 'veh')
otmwrapper.lineplot(time , veh , cols)<jupyter_output><empty_output><jupyter_text>Lane group flows<jupyter_code>cumflw, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'lg', 'flw')
otmwrapper.lineplot(time[1:] , np.diff(cumflw,axis=0)*3600/(time[1]-time[0]) , cols)<jupyter_output><empty_output><jupyter_text>Lane group vehicles<jupyter_code>veh, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'lg', 'veh')
otmwrapper.lineplot(time, veh , cols)<jupyter_output><empty_output><jupyter_text>Cell flows<jupyter_code>cumflw, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'cell', 'flw')
otmwrapper.lineplot(time[1:] , np.diff(cumflw,axis=0)*3600/(time[1]-time[0]) , cols)<jupyter_output><empty_output><jupyter_text>Cell vehicles<jupyter_code>veh, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'cell', 'veh')
otmwrapper.lineplot(time, veh , cols)<jupyter_output><empty_output><jupyter_text>Cell lane changes<jupyter_code>cumflw, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'cell', 'lcin')
otmwrapper.lineplot(time[1:] , np.diff(cumflw,axis=0)*3600/(time[1]-time[0]) , cols)
cumflw, cols, time = otmwrapper.load_data(prefix, output_folder, comm_id, 'cell', 'lcout')
otmwrapper.lineplot(time[1:] , np.diff(cumflw,axis=0)*3600/(time[1]-time[0]) , cols)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14864029666254636, 'fraction_numerical': 0.0157601977750309, 'mean_word_length': 11.354961832061068, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '624897', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1314, 'n_tokens_neox': 1265, 'n_words': 155, 'path': 'python/jupyter_demo.ipynb', 'repo_name': 'bkmgit/otm-tools', 'size': '3236'}