def DATASCHEMA(self): from schema import Schema from compas.data import is_float3 return Schema({ 'points': lambda points: all(is_float3(point) for point in points) })
def DATASCHEMA(self): """:class:`schema.Schema` : Schema of the data representation.""" from schema import Schema from compas.data import is_float3 return Schema({ 'points': lambda points: all(is_float3(point) for point in points) })
def DATASCHEMA(self): """:class:`schema.Schema` : Schema of the data representation.""" import schema from compas.data import is_float3, is_sequence_of_int return schema.Schema({ 'vertices': lambda items: all(is_float3(item) for item in items), 'faces': lambda items: all(is_sequence_of_int(item) for item in items) })
def DATASCHEMA(self): from schema import Schema from compas.data import is_float3 from compas.data import is_sequence_of_int from compas.data import is_sequence_of_float return Schema({ 'points': lambda points: all(is_float3(point) for point in points), 'weights': is_sequence_of_float, 'u_knots': is_sequence_of_float, 'v_knots': is_sequence_of_float, 'u_mults': is_sequence_of_int, 'v_mults': is_sequence_of_int, 'u_degree': int, 'v_degree': int, 'is_u_periodic': bool, 'is_v_periodic': bool })
def DATASCHEMA(self): """:class:`schema.Schema` : The schema of the data representation.""" from schema import Schema from compas.data import is_float3 from compas.data import is_sequence_of_int from compas.data import is_sequence_of_float return Schema({ 'points': lambda points: all(is_float3(point) for point in points), 'weights': is_sequence_of_float, 'u_knots': is_sequence_of_float, 'v_knots': is_sequence_of_float, 'u_mults': is_sequence_of_int, 'v_mults': is_sequence_of_int, 'u_degree': int, 'v_degree': int, 'is_u_periodic': bool, 'is_v_periodic': bool })
def DATASCHEMA(self): """:class:`schema.Schema` : Schema of the data.""" from schema import Schema from compas.data import is_float3 from compas.data import is_sequence_of_int from compas.data import is_sequence_of_float return Schema({ 'points': lambda points: all(is_float3(point) for point in points), 'weights': is_sequence_of_float, 'knots': is_sequence_of_float, 'multiplicities': is_sequence_of_int, 'degree': int, 'is_periodic': bool })
def test_is_float3_invalid(sequence, result): with pytest.raises(TypeError): assert is_float3(sequence) is result
def test_is_float3(sequence, result): assert is_float3(sequence) is result