<jupyter_start><jupyter_text>Load a scope from a yaml file.<jupyter_code>with open('gbnrtc_scope.yaml') as yf:
    for _ in range(100):
        print(yf.readline(), end="")
scope = emat.Scope('gbnrtc_scope.yaml')
scope<jupyter_output><empty_output><jupyter_text>Create a brand new set of `Boxes`.<jupyter_code>boxes = emat.Boxes(scope=scope)<jupyter_output><empty_output><jupyter_text>Define a new top-level box (i.e. a box with no parents to inherit from).<jupyter_code>box_1 = emat.Box(name='High Population Growth', scope=scope)<jupyter_output><empty_output><jupyter_text>Add a lower bound for population growth, to ensure the include values are all "high".<jupyter_code>box_1.set_lower_bound('Land Use - CBD Focus', 1.0)<jupyter_output><empty_output><jupyter_text>Add some things as "relevant features" that we are interested in analyzing,even though we do not set bounds on them (yet).<jupyter_code>box_1.relevant_features.add('Total LRT Boardings')
box_1.relevant_features.add('Downtown to Airport Travel Time')
box_1.relevant_features.add('Peak Transit Share')
box_1.relevant_features.add('AM Trip Time (minutes)')
box_1.relevant_features.add('AM Trip Length (miles)')
box_1.relevant_features.add('Region-wide VMT')
box_1.relevant_features.add('Total Transit Boardings')
box_1.relevant_features.add('Corridor Kensington Daily VMT')
box_1<jupyter_output><empty_output><jupyter_text>Define a new lower level box, which will inherit from the top level box we just created.<jupyter_code>box_2 = emat.Box(name='Automated Vehicles', scope=scope, parent='High Population Growth')<jupyter_output><empty_output><jupyter_text>Set some thresholds on this lower level box.<jupyter_code>box_2.set_lower_bound('Freeway Capacity', 1.25)
box_2.set_upper_bound('Auto IVTT Sensitivity', 0.9)
box_2
box_2.parent_box_name<jupyter_output><empty_output><jupyter_text>So far, the individual boxes we created are just loose boxes.  To connect them, we need to add them to the master `Boxes` object.<jupyter_code>boxes.add(box_1)
boxes.add(box_2)<jupyter_output><empty_output><jupyter_text>We can check on what named boxes are in a `Boxes` object with the `plain_names` method,which just gives the names, or the `fancy_names` method, which adds some iconsto help indicate the hierarchy.<jupyter_code>boxes.plain_names()
boxes.fancy_names()<jupyter_output><empty_output><jupyter_text>Now that the boxes are linked together in a `Boxes` object, we can use the `get_chain` method to aggregatethe attributes of any box along with all parents in the chain.<jupyter_code>boxes.get_chain('Automated Vehicles')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10405508798775823, 'fraction_numerical': 0.010711553175210406, 'mean_word_length': 7.687707641196013, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1797', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 917, 'n_tokens_neox': 875, 'n_words': 231, 'path': 'docs/source/emat.examples/GBNRTC/gbnrtc_fresh_boxes.ipynb', 'repo_name': 'tlumip/tmip-emat', 'size': '2614'}