# Buggy code
def display_single_measurement(self, workspace, figure):
    """Display an array of single measurements"""
    figure.set_subplots((3, len(self.single_measurements)))
    for i, group in enumerate(self.single_measurements):
        bin_hits = workspace.display_data.bins[i]
        labels = workspace.display_data.labels[i]
        values = workspace.display_data.values[i]
        if len(values) == 0:
            continue
        #
        # A histogram of the values
        #
        axes = figure.subplot(0, i)
        axes.hist(values[~np.isnan(values)])
        axes.set_xlabel(group.measurement.value)
        axes.set_ylabel("# of %s" % group.object_name.value)
        #
        # A histogram of the labels yielding the bins
        #
        axes = figure.subplot(1, i)
        axes.hist(
            bin_hits,
            bins=group.number_of_bins(),
            range=(0.5, group.number_of_bins() + 0.5),
        )
        axes.set_xticks(np.arange(1, group.number_of_bins() + 1))
        if group.wants_custom_names:
            axes.set_xticklabels(group.bin_names.value.split(","))
        axes.set_xlabel(group.measurement.value)
        axes.set_ylabel("# of %s" % group.object_name.value)
        colors = self.get_colors(len(axes.patches))
        for j, patch in enumerate(axes.patches):
            patch.set_facecolor(colors[j + 1, :])
        #
        # The labels matrix
        #
        figure.subplot_imshow_labels(
            2,
            i,
            labels,
            title=group.object_name.value,
            renumber=False,
            sharexy=figure.subplot(2, 0),
        )


# Traceback (ValueError)
Traceback (most recent call last):
File "C:\Users\brayma2\Desktop\GitHub\CellProfiler\cellprofiler\gui\pipelinecontroller.py", line 2844, in do_step
self.__pipeline.run_module(module, workspace)
File "C:\Users\brayma2\Desktop\GitHub\CellProfiler\cellprofiler\pipeline.py", line 2108, in run_module
module.run(workspace)
File "C:\Users\brayma2\Desktop\GitHub\CellProfiler\cellprofiler\modules\relateobjects.py", line 252, in run
self.calculate_centroid_distances(workspace, parent_name)
File "C:\Users\brayma2\Desktop\GitHub\CellProfiler\cellprofiler\modules\relateobjects.py", line 336, in calculate_centroid_distances
parents_of = self.get_parents_of(workspace, parent_name)
File "C:\Users\brayma2\Desktop\GitHub\CellProfiler\cellprofiler\modules\relateobjects.py", line 475, in get_parents_of
reverse_lookup_len = max(np.max(primary_parents_of) + 1,
File "C:\Python27\lib\site-packages\numpy\core\fromnumeric.py", line 2263, in amax
out=out, keepdims=keepdims)
File "C:\Python27\lib\site-packages\numpy\core\_methods.py", line 26, in _amax
return umr_maximum(a, axis, None, out, keepdims)
ValueError: zero-size array to reduction operation maximum which has no identity

# Fixed code
def display_single_measurement(self, workspace, figure):
    """Display an array of single measurements"""
    figure.set_subplots((3, len(self.single_measurements)))
    for i, group in enumerate(self.single_measurements):
        bin_hits = workspace.display_data.bins[i]
        labels = workspace.display_data.labels[i]
        values = workspace.display_data.values[i]
        if len(values) == 0:
            continue
        #
        # A histogram of the values
        #
        axes = figure.subplot(0, i)
        axes.hist(values[~np.isnan(values)])
        axes.set_xlabel(group.measurement.value)
        axes.set_ylabel("# of %s" % group.object_name.value)
        #
        # A histogram of the labels yielding the bins
        #
        axes = figure.subplot(1, i)
        axes.hist(
            bin_hits,
            bins=group.number_of_bins(),
            range=(0.5, group.number_of_bins() + 0.5),
        )
        axes.set_xticks(np.arange(1, group.number_of_bins() + 1))
        if group.wants_custom_names:
            axes.set_xticklabels(group.bin_names.value.split(","))
        axes.set_xlabel(group.measurement.value)
        axes.set_ylabel("# of %s" % group.object_name.value)
        colors = self.get_colors(len(axes.patches))
        for j, patch in enumerate(axes.patches):
            patch.set_facecolor(colors[j + 1, :])
        #
        # The labels matrix
        #
        figure.subplot_imshow_labels(
            2, i, labels, title=group.object_name.value, sharexy=figure.subplot(2, 0)
        )