Skip to content

Commit 0e67a90

Browse files
committed
Re Ran Test Representation
Due to some small code review changes, had to re-record the representation.
1 parent 330a262 commit 0e67a90

File tree

3 files changed

+901
-962
lines changed

3 files changed

+901
-962
lines changed

test/example-uniondict-normalization/example_uniondict_normalization.py

+21-19
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
""" Examples adapted from Mecha Munch Management"""
1+
""" Examples adapted from Mecha Munch Management, Alphametrics, and ChatGPT
2+
3+
ChatGPT Prompt: Write a python function that
4+
reads user settings from a toml file and
5+
merges them with a dictionary of default
6+
settings to create a single dictionary.
7+
If there are any conflicts between the
8+
two sources of settings, the data from
9+
the toml file should be used.
10+
"""
11+
12+
213
def update_recipes_tuple(ideas, recipe_updates):
3-
"""Update the recipe ideas dictionary.
14+
"""Mecha Munch Management Example.
15+
16+
Update the recipe ideas dictionary.
417
:param ideas: dict - The "recipe ideas" dict.
518
:param recipe_updates: tuple - tuple with updates for the ideas section.
619
:return: dict - updated "recipe ideas" dict.
@@ -14,7 +27,9 @@ def update_recipes_tuple(ideas, recipe_updates):
1427

1528

1629
def update_recipes_dict(ideas, recipe_updates):
17-
"""Update the recipe ideas dictionary.
30+
"""Second Mecha Munch Management Example.
31+
32+
Update the recipe ideas dictionary.
1833
:param ideas: dict - The "recipe ideas" dict.
1934
:param recipe_updates: dict - dictionary with updates for the ideas section.
2035
:return: dict - updated "recipe ideas" dict.
@@ -37,9 +52,9 @@ def update_recipes_dict(ideas, recipe_updates):
3752
# {'Banana Bread': {'Banana': 4, 'Walnuts': 2, 'Flour': 1, 'Eggs': 3, 'Butter': 1, 'Milk': 2}}
3853

3954

40-
41-
""" Example from `alphametrics` exercise """
4255
def assign(letters, selections, lefty, righty):
56+
""" Example from `alphametrics` exercise """
57+
4358
while letters:
4459
new_selections = []
4560

@@ -61,19 +76,6 @@ def assign(letters, selections, lefty, righty):
6176
return [slc for slc, _ in selections]
6277

6378

64-
65-
66-
67-
"""
68-
This exmple comes from ChatGPT
69-
Prompt: Write a python function that
70-
reads user settings from a toml file and
71-
merges them with a dictionary of default
72-
settings to create a single dictionary.
73-
If there are any conflicts between the
74-
two sources of settings, the data from
75-
the toml file should be used.
76-
"""
7779
import tomlib
7880

7981
def merge_settings(default_settings, toml_file_path):
@@ -95,4 +97,4 @@ def merge_settings(default_settings, toml_file_path):
9597
toml_file_path = 'settings.toml' # Path to the TOML file
9698

9799
final_settings = merge_settings(default_settings, toml_file_path)
98-
print("Final Settings:", final_settings)
100+
print("Final Settings:", final_settings)

0 commit comments

Comments
 (0)