code: def to_dict(self):
          
          def _json_safe(v):
              if isinstance(v, np.ndarray):
                  return v.tolist()
              elif is_unit(v)[0]:
                  return v.to_string()
              else:
                  return v
          d = {k:_json_safe(v) for k,v in self._descriptors.items()}
          d['nparray'] = self.__class__.__name__.lower()
          return d
docs: dump a representation of the nparray object to a dictionary.  The
          nparray object should then be able to be fully restored via
          nparray.from_dict