Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-5855

Accessing invalid attributes produces unhelpful error message

    Details

    • Templates:
    • Epic Link:
    • Team:
      Data Release Production

      Description

      While trying to introspect afw.table, I tried "table.deepcopy()" and got a "Record data is not contiguous in memory." error. This was not helpful.

      In fact, table.ANYTHING (parentheses or not) gives the same error. Looking in tableLib __getattribute__, there should maybe be an except clause for the getattr(columns), to properly deal with this case and produce a more helpful error message?

      In [164]: xx.deepcopy()
      ---------------------------------------------------------------------------
      RuntimeError                              Traceback (most recent call last)
      <ipython-input-164-9d4dd7ea8bd1> in <module>()
      ----> 1 xx.deepcopy()
       
      /Users/parejkoj/lsst/lsstsw/stack/DarwinX86/afw/2.2016.10-9-gc64e176/python/lsst/afw/table/tableLib.pyc in __getattribute__(self, name)
         8142             return getattr(self.table, name)
         8143         except AttributeError:
      -> 8144             return getattr(self.columns, name)
         8145     table = property(getTable)
         8146     schema = property(getSchema)
       
      /Users/parejkoj/lsst/lsstsw/stack/DarwinX86/afw/2.2016.10-9-gc64e176/python/lsst/afw/table/tableLib.pyc in __getattribute__(self, name)
         8132         # We have to use __getattribute__ because SWIG overrides __getattr__.
         8133         try:
      -> 8134             return object.__getattribute__(self, name)
         8135         except AttributeError:
         8136             # self._columns is created the when self.columns is accessed -
       
      /Users/parejkoj/lsst/lsstsw/stack/DarwinX86/afw/2.2016.10-9-gc64e176/python/lsst/afw/table/tableLib.pyc in __getColumns(self)
         8097     def __getColumns(self):
         8098         if not hasattr(self, "_columns") or self._columns is None:
      -> 8099             self._columns = self.getColumnView()
         8100         return self._columns
         8101     columns = property(__getColumns, doc="a column view of the catalog")
       
      /Users/parejkoj/lsst/lsstsw/stack/DarwinX86/afw/2.2016.10-9-gc64e176/python/lsst/afw/table/tableLib.pyc in getColumnView(self)
         7970     def getColumnView(self):
         7971         """getColumnView(_SimpleCatalogBase self) -> SimpleColumnView"""
      -> 7972         val = _tableLib._SimpleCatalogBase_getColumnView(self)
         7973         self._columns = val
         7974
       
      RuntimeError:
        File "include/lsst/afw/table/BaseColumnView.h", line 205, in static lsst::afw::table::BaseColumnView lsst::afw::table::BaseColumnView::make(const boost::shared_ptr<BaseTable> &, InputIterator, InputIterator) [InputIterator = lsst::afw::table::CatalogIterator<std::__1::__wrap_iter<const boost::shared_ptr<lsst::afw::table::SimpleRecord> *> >]
          Record data is not contiguous in memory. {0}
      lsst::pex::exceptions::RuntimeError: 'Record data is not contiguous in memory.'
      

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  Parejkoj John Parejko
                  Watchers:
                  Colin Slater, Jim Bosch, John Parejko, John Swinbank, Krzysztof Findeisen, Meredith Rawls, Paul Price, Russell Owen, Simon Krughoff
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Summary Panel