# Buggy code
def _repr_html_(self):
    """A pretty representation for Jupyter notebooks that includes header
    details and information about all scalar arrays"""
    fmt = ""
    if self.n_arrays > 0:
        fmt += "<table>"
        fmt += "<tr><th>Header</th><th>Data Arrays</th></tr>"
        fmt += "<tr><td>"
    # Get the header info
    fmt += self.head(display=False, html=True)
    # Fill out scalar arrays
    if self.n_arrays > 0:
        fmt += "</td><td>"
        fmt += "\n"
        fmt += "<table>\n"
        titles = ["Name", "Field", "Type", "N Comp", "Min", "Max"]
        fmt += "<tr>" + "".join(["<th>{}</th>".format(t) for t in titles]) + "</tr>\n"
        row = "<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>\n"
        row = "<tr>" + "".join(["<td>{}</td>" for i in range(len(titles))]) + "</tr>\n"

        def format_array(key, field):
            """internal helper to foramt array information for printing"""
            arr = get_scalar(self, key, preference=field)
            dl, dh = self.get_data_range(key)
            dl = pyvista.FLOAT_FORMAT.format(dl)
            dh = pyvista.FLOAT_FORMAT.format(dh)
            if key == self.active_scalar_info[1]:
                key = "<b>{}</b>".format(key)
            if arr.ndim > 1:
                ncomp = arr.shape[1]
            else:
                ncomp = 1
            return row.format(key, field, arr.dtype, ncomp, dl, dh)

        for i in range(self.GetPointData().GetNumberOfArrays()):
            key = self.GetPointData().GetArrayName(i)
            fmt += format_array(key, field="Points")
        for i in range(self.GetCellData().GetNumberOfArrays()):
            key = self.GetCellData().GetArrayName(i)
            fmt += format_array(key, field="Cells")
        for i in range(self.GetFieldData().GetNumberOfArrays()):
            key = self.GetFieldData().GetArrayName(i)
            fmt += format_array(key, field="Fields")

        fmt += "</table>\n"
        fmt += "\n"
        fmt += "</td></tr> </table>"
    return fmt


# Traceback (RecursionError)
---------------------------------------------------------------------------
RecursionError                            Traceback (most recent call last)
<ipython-input-15-403e4a0f4e87> in <module>
9
10 # Try to access the point arrays
---> 11 continents.point_arrays

~/Documents/OpenGeoVis/Software/pyvista/pyvista/core/common.py in point_arrays(self)
697         for i in range(narr):
698             name = pdata.GetArrayName(i)
--> 699             self._point_arrays[name] = self._point_scalar(name)
700
701         self._point_arrays.enable_callback()

~/Documents/OpenGeoVis/Software/pyvista/pyvista/core/common.py in _point_scalar(self, name)
342         if name is None:
343             # use active scalar array
--> 344             field, name = self.active_scalar_info
345             if field != POINT_DATA_FIELD:
346                 raise RuntimeError('Must specify an array to fetch.')

~/Documents/OpenGeoVis/Software/pyvista/pyvista/core/common.py in active_scalar_info(self)
53
54         # rare error where scalar name isn't a valid scalar
---> 55         if name not in self.point_arrays:
56             if name not in self.cell_arrays:
57                 if name in self.field_arrays:

... last 3 frames repeated, from the frame below ...

~/Documents/OpenGeoVis/Software/pyvista/pyvista/core/common.py in point_arrays(self)
697         for i in range(narr):
698             name = pdata.GetArrayName(i)
--> 699             self._point_arrays[name] = self._point_scalar(name)
700
701         self._point_arrays.enable_callback()

RecursionError: maximum recursion depth exceeded

# Fixed code
def _repr_html_(self):
    """A pretty representation for Jupyter notebooks that includes header
    details and information about all scalar arrays"""
    fmt = ""
    if self.n_arrays > 0:
        fmt += "<table>"
        fmt += "<tr><th>Header</th><th>Data Arrays</th></tr>"
        fmt += "<tr><td>"
    # Get the header info
    fmt += self.head(display=False, html=True)
    # Fill out scalar arrays
    if self.n_arrays > 0:
        fmt += "</td><td>"
        fmt += "\n"
        fmt += "<table>\n"
        titles = ["Name", "Field", "Type", "N Comp", "Min", "Max"]
        fmt += "<tr>" + "".join(["<th>{}</th>".format(t) for t in titles]) + "</tr>\n"
        row = "<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>\n"
        row = "<tr>" + "".join(["<td>{}</td>" for i in range(len(titles))]) + "</tr>\n"

        def format_array(name, arr, field):
            """internal helper to foramt array information for printing"""
            dl, dh = self.get_data_range(arr)
            dl = pyvista.FLOAT_FORMAT.format(dl)
            dh = pyvista.FLOAT_FORMAT.format(dh)
            if name == self.active_scalar_info[1]:
                name = "<b>{}</b>".format(name)
            if arr.ndim > 1:
                ncomp = arr.shape[1]
            else:
                ncomp = 1
            return row.format(name, field, arr.dtype, ncomp, dl, dh)

        for key, arr in self.point_arrays.items():
            fmt += format_array(key, arr, "Points")
        for key, arr in self.cell_arrays.items():
            fmt += format_array(key, arr, "Cells")
        for key, arr in self.field_arrays.items():
            fmt += format_array(key, arr, "Fields")

        fmt += "</table>\n"
        fmt += "\n"
        fmt += "</td></tr> </table>"
    return fmt