Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

computed quat thing doesn't print well #262

Open
jeanconn opened this issue May 1, 2024 · 0 comments
Open

computed quat thing doesn't print well #262

jeanconn opened this issue May 1, 2024 · 0 comments
Labels

Comments

@jeanconn
Copy link
Contributor

jeanconn commented May 1, 2024

I think this is basically a repr issue but it is awkward for the user -

In [1]: from cheta import fetch

In [2]: fetch.Msid('quat_aoattqt', '2024:001', '2024:002')
Out[2]: ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
File /fido.real/conda/envs/ska3-flight-2024.1rc4/lib/python3.11/site-packages/IPython/core/formatters.py:711, in PlainTextFormatter.__call__(self, obj)
    704 stream = StringIO()
    705 printer = pretty.RepresentationPrinter(stream, self.verbose,
    706     self.max_width, self.newline,
    707     max_seq_length=self.max_seq_length,
    708     singleton_pprinters=self.singleton_printers,
    709     type_pprinters=self.type_printers,
    710     deferred_pprinters=self.deferred_printers)
--> 711 printer.pretty(obj)
    712 printer.flush()
    713 return stream.getvalue()

File /fido.real/conda/envs/ska3-flight-2024.1rc4/lib/python3.11/site-packages/IPython/lib/pretty.py:411, in RepresentationPrinter.pretty(self, obj)
    408                         return meth(obj, self, cycle)
    409                 if cls is not object \
    410                         and callable(cls.__dict__.get('__repr__')):
--> 411                     return _repr_pprint(obj, self, cycle)
    413     return _default_pprint(obj, self, cycle)
    414 finally:

File /fido.real/conda/envs/ska3-flight-2024.1rc4/lib/python3.11/site-packages/IPython/lib/pretty.py:779, in _repr_pprint(obj, p, cycle)
    777 """A pprint that just redirects to the normal repr function."""
    778 # Find newlines and replace them with p.break_()
--> 779 output = repr(obj)
    780 lines = output.splitlines()
    781 with p.group():

File /fido.real/conda/envs/ska3-flight-2024.1rc4/lib/python3.11/site-packages/cheta/fetch.py:601, in MSID.__repr__(self)
    595 def __repr__(self):
    596     attrs = [self.__class__.__name__, self.MSID]
    597     for name, val in (
    598         ("start", self.datestart),
    599         ("stop", self.datestop),
    600         ("len", len(self)),
--> 601         ("dtype", self.dtype.name),
    602         ("unit", self.unit),
    603         ("stat", self.stat),
    604     ):
    605         if val is not None:
    606             attrs.append("{}={}".format(name, val))

File /fido.real/conda/envs/ska3-flight-2024.1rc4/lib/python3.11/site-packages/cheta/fetch.py:593, in MSID.dtype(self)
    591 @property
    592 def dtype(self):
--> 593     return self.vals.dtype

AttributeError: 'Quat' object has no attribute 'dtype'
@jeanconn jeanconn added the bug label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant