Skip to content

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
vruusmann committed Mar 31, 2024
1 parent 037b665 commit e89c0db
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public Boolean getNormalize(){

@SuppressWarnings("unchecked")
public Map<Object, Map<Object, String>> getMinGroupCategories(){
Map<Object, String> minGroupCategories = get("_min_group_categories", Map.class);
Map<Object, String> minGroupCategories = (Map)getDict("_min_group_categories");

return CategoryEncoderUtil.toTransformedMap(minGroupCategories, key -> ScalarUtil.decode(key), value -> (Map<Object, String>)value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MapEncoder(String module, String name){
public String functionName();

public Map<Object, Series> getMapping(){
Map<?, ?> mapping = get("mapping", Map.class);
Map<?, ?> mapping = getDict("mapping");

return CategoryEncoderUtil.toTransformedMap(mapping, key -> ScalarUtil.decode(key), value -> (Series)value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public String getDerivedName(){

@Override
public Map<Object, Series> getMapping(){
Map<?, ?> mapping = get("mapping", Map.class);
Map<?, ?> mapping = getDict("mapping");

return CategoryEncoderUtil.toTransformedMap(mapping, key -> ScalarUtil.decode(key), value -> toMeanSeries((DataFrame)value, createFunction()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public Map<?, Integer> getCategoryMapping(){

return SeriesUtil.toMap(mapping, Functions.identity(), ValueUtil::asInteger);
} catch(IllegalArgumentException iae){
return get("mapping", Map.class);
return (Map)getDict("mapping");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ public String getSeparator(){
}

public Map<String, Integer> getVocabulary(){
return get("vocabulary_", Map.class);
return (Map)getDict("vocabulary_");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ protected Map<String, List<Object>> parseMapping(List<String> inputColumns, Stri
}

public Map<?, ?> getMapping(){
return get("mapping", Map.class);
return getDict("mapping");
}

public Object getDefaultValue(){
Expand Down

0 comments on commit e89c0db

Please sign in to comment.