77from src .spaces .action_space import ActionSpace
88from src .spaces .actions import ActionSuppress , ActionGeneralize
99from src .exceptions .exceptions import Error
10- from src .utils .default_hierarchy import DefaultHierarchy
10+ from src .utils .serial_hierarchy import SerialHierarchy
1111from src .utils .string_distance_calculator import DistanceType
1212from src .datasets .dataset_wrapper import PandasDSWrapper
1313
@@ -35,7 +35,7 @@ def setUp(self) -> None:
3535 "drop_na" : True ,
3636 "change_col_vals" : {"diagnosis" : [('N' , 0 )]}})
3737
38- @pytest .mark .skip (reason = "no way of currently testing this" )
38+ # @pytest.mark.skip(reason="no way of currently testing this")
3939 def test_prepare_column_states_throw_Error (self ):
4040 # specify the action space. We need to establish how these actions
4141 # are performed
@@ -47,7 +47,7 @@ def test_prepare_column_states_throw_Error(self):
4747 with pytest .raises (Error ):
4848 env .prepare_column_states ()
4949
50- @pytest .mark .skip (reason = "no way of currently testing this" )
50+ # @pytest.mark.skip(reason="no way of currently testing this")
5151 def test_prepare_column_states (self ):
5252 # specify the action space. We need to establish how these actions
5353 # are performed
@@ -59,7 +59,7 @@ def test_prepare_column_states(self):
5959 env .initialize_text_distances (distance_type = DistanceType .COSINE )
6060 env .prepare_column_states ()
6161
62- @pytest .mark .skip (reason = "no way of currently testing this" )
62+ # @pytest.mark.skip(reason="no way of currently testing this")
6363 def test_get_numeric_ds (self ):
6464 # specify the action space. We need to establish how these actions
6565 # are performed
@@ -85,24 +85,24 @@ def test_apply_action(self):
8585 # are performed
8686 action_space = ActionSpace (n = 1 )
8787
88- generalization_table = {"Mixed White/Asian" : DefaultHierarchy (values = ["Mixed" , ]),
89- "Chinese" : DefaultHierarchy (values = ["Asian" , ]),
90- "Indian" : DefaultHierarchy (values = ["Asian" , ]),
91- "Mixed White/Black African" : DefaultHierarchy (values = ["Mixed" , ]),
92- "Black African" : DefaultHierarchy (values = ["Black" , ]),
93- "Asian other" : DefaultHierarchy (values = ["Asian" , ]),
94- "Black other" : DefaultHierarchy (values = ["Black" , ]),
95- "Mixed White/Black Caribbean" : DefaultHierarchy (values = ["Mixed" , ]),
96- "Mixed other" : DefaultHierarchy (values = ["Mixed" , ]),
97- "Arab" : DefaultHierarchy (values = ["Asian" , ]),
98- "White Irish" : DefaultHierarchy (values = ["White" , ]),
99- "Not stated" : DefaultHierarchy (values = ["Not stated" ]),
100- "White Gypsy/Traveller" : DefaultHierarchy (values = ["White" , ]),
101- "White British" : DefaultHierarchy (values = ["White" , ]),
102- "Bangladeshi" : DefaultHierarchy (values = ["Asian" , ]),
103- "White other" : DefaultHierarchy (values = ["White" , ]),
104- "Black Caribbean" : DefaultHierarchy (values = ["Black" , ]),
105- "Pakistani" : DefaultHierarchy (values = ["Asian" , ])}
88+ generalization_table = {"Mixed White/Asian" : SerialHierarchy (values = ["Mixed" , ]),
89+ "Chinese" : SerialHierarchy (values = ["Asian" , ]),
90+ "Indian" : SerialHierarchy (values = ["Asian" , ]),
91+ "Mixed White/Black African" : SerialHierarchy (values = ["Mixed" , ]),
92+ "Black African" : SerialHierarchy (values = ["Black" , ]),
93+ "Asian other" : SerialHierarchy (values = ["Asian" , ]),
94+ "Black other" : SerialHierarchy (values = ["Black" , ]),
95+ "Mixed White/Black Caribbean" : SerialHierarchy (values = ["Mixed" , ]),
96+ "Mixed other" : SerialHierarchy (values = ["Mixed" , ]),
97+ "Arab" : SerialHierarchy (values = ["Asian" , ]),
98+ "White Irish" : SerialHierarchy (values = ["White" , ]),
99+ "Not stated" : SerialHierarchy (values = ["Not stated" ]),
100+ "White Gypsy/Traveller" : SerialHierarchy (values = ["White" , ]),
101+ "White British" : SerialHierarchy (values = ["White" , ]),
102+ "Bangladeshi" : SerialHierarchy (values = ["Asian" , ]),
103+ "White other" : SerialHierarchy (values = ["White" , ]),
104+ "Black Caribbean" : SerialHierarchy (values = ["Black" , ]),
105+ "Pakistani" : SerialHierarchy (values = ["Asian" , ])}
106106
107107 action_space .add (ActionGeneralize (column_name = "ethnicity" , generalization_table = generalization_table ))
108108
0 commit comments