Skip to content

Commit

Permalink
Change nomenclature
Browse files Browse the repository at this point in the history
Reduced resolutions is easier

Updates #723
  • Loading branch information
shawnlaffan committed Apr 7, 2019
1 parent 59112f3 commit 0da9065
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions bin/ui/wndMain.ui
Expand Up @@ -173,11 +173,11 @@ This will create a new basedata with the corrected axis orders. </property>
</object>
</child>
<child>
<object class="GtkAction" id="menu_basedata_coarsen_axis_resolutions">
<property name="name">menu_basedata_coarsen_axis_resolutions</property>
<property name="tooltip" translatable="yes">Create a new basedata with coarser axis resolutions (cell sizes).</property>
<property name="label" translatable="yes">Duplicate with coarser cell sizes</property>
<signal handler="on_basedata_coarsen_axis_resolutions" name="activate"/>
<object class="GtkAction" id="menu_basedata_reduce_axis_resolutions">
<property name="name">menu_basedata_reduce_axis_resolutions</property>
<property name="tooltip" translatable="yes">Create a new basedata with reduced axis resolutions (coarser cell sizes).</property>
<property name="label" translatable="yes">Duplicate with reduced resolutions</property>
<signal handler="on_basedata_reduce_axis_resolutions" name="activate"/>
</object>
</child>
<child>
Expand Down Expand Up @@ -734,7 +734,7 @@ This cannot be undone. </property>
<menuitem action="menu_basedata_duplicate"/>
<menuitem action="menu_basedata_duplicate_no_outputs"/>
<menuitem action="menu_basedata_reorder_axes"/>
<menuitem action="menu_basedata_coarsen_axis_resolutions"/>
<menuitem action="menu_basedata_reduce_axis_resolutions"/>
<menuitem action="menu_basedata_transpose"/>
<menuitem action="menu_merge_basedatas"/>
<menuitem action="menu_basedata_auto_remap"/>
Expand Down
4 changes: 2 additions & 2 deletions lib/Biodiverse/BaseData.pm
Expand Up @@ -373,7 +373,7 @@ sub clone {
return $cloneref;
}

sub clone_with_coarser_cell_sizes {
sub clone_with_reduced_resolution {
my ($self, %args) = @_;

my $new_cell_sizes = $args{cell_sizes};
Expand All @@ -395,7 +395,7 @@ sub clone_with_coarser_cell_sizes {
my $current = $current_cell_sizes->[$i];
my $new = $new_cell_sizes->[$i];

croak "cannot coarsen a non-numeric axis (axis $i)\n"
croak "cannot change resolution of a non-numeric axis (axis $i)\n"
if $current < 0 and $current != $new;
croak "new axis size is less than current"
if $current > $new;
Expand Down
4 changes: 2 additions & 2 deletions lib/Biodiverse/GUI/Callbacks.pm
Expand Up @@ -243,8 +243,8 @@ my %data_funcs = (
METHOD => 'do_duplicate_basedata',
ARGS => { no_outputs => 1, }
},
on_basedata_coarsen_axis_resolutions => {
METHOD => 'do_basedata_coarsen_axis_resolutions',
on_basedata_reduce_axis_resolutions => {
METHOD => 'do_basedata_reduce_axis_resolutions',
},
on_basedata_export_groups => {
METHOD => 'do_export_groups',
Expand Down
6 changes: 3 additions & 3 deletions lib/Biodiverse/GUI/GUIManager.pm
Expand Up @@ -1504,7 +1504,7 @@ sub do_duplicate_basedata {
return;
}

sub do_basedata_coarsen_axis_resolutions {
sub do_basedata_reduce_axis_resolutions {
my $self = shift;

my $bd = $self->{project}->get_selected_base_data();
Expand Down Expand Up @@ -1552,7 +1552,7 @@ sub do_basedata_coarsen_axis_resolutions {
);

my $dlg = Gtk2::Dialog->new (
'Coarsen basedata resolution',
'Reduce basedata resolution',
$self->get_object('wndMain'),
'modal',
'gtk-ok' => 'ok',
Expand Down Expand Up @@ -1585,7 +1585,7 @@ sub do_basedata_coarsen_axis_resolutions {
my @cell_origins = map {$_->get_value} @$origin_widgets;
$dlg->destroy();

my $cloned = $bd->clone_with_coarser_cell_sizes(
my $cloned = $bd->clone_with_reduced_reslution (
name => $chosen_name,
cell_sizes => \@cell_sizes,
cell_origins => \@cell_origins,
Expand Down
2 changes: 1 addition & 1 deletion lib/Biodiverse/GUI/Project.pm
Expand Up @@ -1290,7 +1290,7 @@ sub manage_empty_basedatas {
menu_basedata_save
menu_basedata_duplicate
menu_basedata_duplicate_no_outputs
menu_basedata_coarsen_axis_resolutions
menu_basedata_reduce_axis_resolutions
menu_basedata_transpose
menu_basedata_rename
menu_basedata_describe
Expand Down
4 changes: 2 additions & 2 deletions t/11-BaseData.t
Expand Up @@ -395,7 +395,7 @@ sub test_binarise_sample_counts {
}


sub test_coarsen_cell_sizes {
sub test_reduce_resolution {
my $bd1 = Biodiverse::BaseData->new(CELL_SIZES => [1, 1]);
my $bdc_22 = Biodiverse::BaseData->new(CELL_SIZES => [2, 2]);
my $bdc_21 = Biodiverse::BaseData->new(CELL_SIZES => [2, 1]);
Expand Down Expand Up @@ -437,7 +437,7 @@ sub test_coarsen_cell_sizes {
my $sizes = $sizes{$size_key}[1];
my $origins = $sizes{$size_key}[2];

my $bd2 = $bd1->clone_with_coarser_cell_sizes (
my $bd2 = $bd1->clone_with_reduced_resolution (
cell_sizes => $sizes,
cell_origins => $origins,
);
Expand Down

0 comments on commit 0da9065

Please sign in to comment.