# Buggy code
def get_step_parents(self, pipeline):
    """Return the possible step-parents associated with the parent"""
    step_parents = set()

    parent_name = self.parent_name.value

    for module in pipeline.modules():
        if module.module_num == self.module_num:
            return list(step_parents)

        # Objects that are the parent of the parents
        grandparents = module.get_measurements(
            pipeline, parent_name, cellprofiler.measurement.C_PARENT
        )

        step_parents.update(grandparents)

        # Objects that are the children of the parents
        siblings = module.get_measurements(
            pipeline, parent_name, cellprofiler.measurement.C_CHILDREN
        )

        for sibling in siblings:
            match = re.match("^([^_]+)_Count", sibling)

            if match is not None:
                sibling_name = match.groups()[0]

                if parent_name in module.get_measurements(
                    pipeline, sibling_name, cellprofiler.measurement.C_PARENT
                ):
                    step_parents.add(sibling_name)

    return list(step_parents)


# 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 get_step_parents(self, pipeline):
    """Return the possible step-parents associated with the parent"""
    step_parents = set()

    parent_name = self.x_name.value

    for module in pipeline.modules():
        if module.module_num == self.module_num:
            return list(step_parents)

        # Objects that are the parent of the parents
        grandparents = module.get_measurements(
            pipeline, parent_name, cellprofiler.measurement.C_PARENT
        )

        step_parents.update(grandparents)

        # Objects that are the children of the parents
        siblings = module.get_measurements(
            pipeline, parent_name, cellprofiler.measurement.C_CHILDREN
        )

        for sibling in siblings:
            match = re.match("^([^_]+)_Count", sibling)

            if match is not None:
                sibling_name = match.groups()[0]

                if parent_name in module.get_measurements(
                    pipeline, sibling_name, cellprofiler.measurement.C_PARENT
                ):
                    step_parents.add(sibling_name)

    return list(step_parents)