You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I like this feature in Astropy. For example, I can add information to a Quantity object Q using its info attribute like so:
# Add information (name, meta, description) to an Astropy Quantity Q
def add_info(Q, name=None, meta=None, description=None):
if name: Q.info.name = name
if meta: Q.info.meta = meta
if description: Q.info.description = description
return Q
This is handy for attaching a brief description to the object or a TeX-formatted string for axes labels.
The text was updated successfully, but these errors were encountered:
Sorry for the delay. I don't see much added value in supporting this in unyt. unyt.Unit objects have a latex_representation method that already fills your needs (axis labels); you should be able to format a label from a unyt_quantity (q) as, for instance
Overall I currently don't think there's a need for this feature in unyt, and I'm inclined to close this ticket, but I'll give a chance to interested parties to voice their opinions.
@gregsalvesen-work, can you give an example of something this would enable that's not already cleanly achievable using existing interface ?
Can a
unyt_array
orunyt_quantity
store metadata?I like this feature in
Astropy
. For example, I can add information to aQuantity
objectQ
using itsinfo
attribute like so:This is handy for attaching a brief description to the object or a TeX-formatted string for axes labels.
The text was updated successfully, but these errors were encountered: