Skip to content

Commit 66c5de0

Browse files
author
Joel Collins
committed
Fixed #25. Lets never speak of this again.
1 parent 1029a2d commit 66c5de0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

labthings/server/types.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def to_string(o):
9393
}
9494

9595

96-
def make_primative(value):
97-
"""Attempt to convert a value into a primative Python type
96+
def make_primitive(value):
97+
"""Attempt to convert a value into a primitive Python type
9898
9999
Args:
100100
value: Data to convert
@@ -104,7 +104,7 @@ def make_primative(value):
104104
"""
105105
global DEFAULT_BUILTIN_CONVERSIONS, DEFAULT_TYPE_MAPPING
106106

107-
logging.debug(f"Converting {value} to primative type...")
107+
logging.debug(f"Converting {value} to primitive type...")
108108
value_typestrings = [
109109
x.__module__ + "." + x.__name__ for x in inspect.getmro(type(value))
110110
]
@@ -114,7 +114,7 @@ def make_primative(value):
114114
value = DEFAULT_BUILTIN_CONVERSIONS.get(typestring)(value)
115115
break
116116

117-
# If the final type is not primative
117+
# If the final type is not primitive
118118
if not type(value) in DEFAULT_TYPE_MAPPING:
119119
# Fall back to a string representation
120120
value = str(value)
@@ -158,7 +158,7 @@ def data_dict_to_schema(data_dict: dict):
158158
"""
159159
working_dict = copy.deepcopy(data_dict)
160160

161-
working_dict = rapply(working_dict, make_primative)
161+
working_dict = rapply(working_dict, make_primitive)
162162
working_dict = rapply(working_dict, value_to_field, apply_to_iterables=False)
163163

164164
return working_dict

tests/test_server_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def types_dict():
3131
return d, s
3232

3333

34-
def test_make_primative():
35-
assert types.make_primative(Fraction(5, 2)) == 2.5
34+
def test_make_primitive():
35+
assert types.make_primitive(Fraction(5, 2)) == 2.5
3636

3737

3838
def test_value_to_field():

0 commit comments

Comments
 (0)