Skip to content

Commit

Permalink
Make exclusions actually work.
Browse files Browse the repository at this point in the history
Updates #630
  • Loading branch information
LukedFitzpatrick committed Jan 20, 2017
1 parent 188a190 commit d9b6c9d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/Biodiverse/GUI/Export.pm
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ sub Run {

eval {
$object->export(
format => $selected_format,
file => $filename,
format => $selected_format,
file => $filename,
export_colours => $export_colours,
@$params,
)
};
Expand Down
7 changes: 5 additions & 2 deletions lib/Biodiverse/TreeNode/BootstrapBlock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ sub encode_bootstrap_block {

if($args{exclusions}) {
my @excluded_keys = @{$args{exclusions}};
# print "Exclusions are: @excluded_keys\n";
foreach my $exclusion (@excluded_keys) {
delete $boot_values{$exclusion};
}
Expand All @@ -87,8 +88,10 @@ sub encode_bootstrap_block {
$json_string = scalar reverse $json_string; # cheeky
$json_string =~ s/\}/\]/;
$json_string = scalar reverse $json_string;

return $json_string;

# if we have nothing in this block, we probably don't want to
# write out [], makes the nexus file ugly.
return $json_string eq "[]" ? "" : $json_string;
}


Expand Down

0 comments on commit d9b6c9d

Please sign in to comment.