<s> from __future__ import absolute_import , division , print_function <EOL> import numpy as np <EOL> from glue . core . component import Component , CategoricalComponent <EOL> from glue . core . data import Data <EOL> def test_histogram_data ( ) : <EOL> data = Data ( label = "<STR_LIT>" ) <EOL> comp_a = Component ( np . random . uniform ( size = <NUM_LIT> ) ) <EOL> comp_b = Component ( np . random . normal ( size = <NUM_LIT> ) ) <EOL> data . add_component ( comp_a , '<STR_LIT>' ) <EOL> data . add_component ( comp_b , '<STR_LIT>' ) <EOL> return data <EOL> def test_data ( ) : <EOL> data = Data ( label = "<STR_LIT>" ) <EOL> data2 = Data ( label = "<STR_LIT>" ) <EOL> comp_a = Component ( np . array ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) ) <EOL> comp_b = Component ( np . array ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) ) <EOL> comp_c = Component ( np . array ( [ <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:6> ] ) ) <EOL> comp_d = Component ( np . array ( [ <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:5> ] ) ) <EOL> data . add_component ( comp_a , '<STR_LIT:a>' ) <EOL> data . add_component ( comp_b , '<STR_LIT:b>' ) <EOL> data2 . add_component ( comp_c , '<STR_LIT:c>' ) <EOL> data2 . add_component ( comp_d , '<STR_LIT:d>' ) <EOL> return data , data2 <EOL> def test_categorical_data ( ) : <EOL> data = Data ( label = "<STR_LIT>" ) <EOL> data2 = Data ( label = "<STR_LIT>" ) <EOL> comp_x1 = CategoricalComponent ( np . array ( [ '<STR_LIT:a>' , '<STR_LIT:a>' , '<STR_LIT:b>' ] ) ) <EOL> comp_y1 = Component ( np . array ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) ) <EOL> comp_x2 = CategoricalComponent ( np . array ( [ '<STR_LIT:c>' , '<STR_LIT:a>' , '<STR_LIT:b>' ] ) ) <EOL> comp_y2 = Component ( np . array ( [ <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:5> ] ) ) <EOL> data . add_component ( comp_x1 , '<STR_LIT>' ) <EOL> data . add_component ( comp_y1 , '<STR_LIT>' ) <EOL> data2 . add_component ( comp_x2 , '<STR_LIT>' ) <EOL> data2 . add_component ( comp_y2 , '<STR_LIT>' ) <EOL> return data , data2 <EOL> def test_image ( ) : <EOL> data = Data ( label = "<STR_LIT>" ) <EOL> comp_a = Component ( np . ones ( ( <NUM_LIT> , <NUM_LIT> ) ) ) <EOL> data . add_component ( comp_a , '<STR_LIT>' ) <EOL> comp_b = Component ( np . zeros ( ( <NUM_LIT> , <NUM_LIT> ) ) ) <EOL> data . add_component ( comp_b , '<STR_LIT>' ) <EOL> return data <EOL> def test_cube ( ) : <EOL> data = Data ( label = "<STR_LIT>" ) <EOL> comp_a = Component ( np . ones ( ( <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:16> ) ) ) <EOL> data . add_component ( comp_a , '<STR_LIT>' ) <EOL> return data </s>
