Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
#
# properties documentation build configuration file, created by
# sphinx-quickstart on Thu May 12 10:22:17 2016.
Expand Down
19 changes: 10 additions & 9 deletions properties/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,15 +418,16 @@ def validate(self, instance, value):
"""
if not isinstance(value, (tuple, list, np.ndarray)):
self.error(instance, value)
for i, val in enumerate(value):
if isinstance(val, string_types):
if val.upper() not in VECTOR_DIRECTIONS:
self.error(
instance=instance,
value=val,
extra='This is an invalid Vector3 representation.',
)
value[i] = VECTOR_DIRECTIONS[val.upper()]
if isinstance(value, (tuple, list)):
for i, val in enumerate(value):
if isinstance(val, string_types):
if val.upper() not in VECTOR_DIRECTIONS:
self.error(
instance=instance,
value=val,
extra='This is an invalid Vector3 representation.',
)
value[i] = VECTOR_DIRECTIONS[val.upper()]

return super(Vector3Array, self).validate(instance, value)

Expand Down