Add narrative documentation for physical types#11606
Conversation
|
👋 Thank you for your draft pull request! Do you know that you can use |
|
Not necessarily this particular example per se, but maybe include an example where a unit can have multiple physical types? I ran into this one in my downstream package: >>> from astropy import units as u
>>> FLAM = u.def_unit(
... 'flam', u.erg / (u.cm**2 * u.s * u.AA),
... format={'generic': 'FLAM', 'console': 'FLAM'})
>>> FLAM.physical_type
PhysicalType({'power density', 'spectral flux density wav'}) |
Agreed! I still have to write that part, as well as an example on dimensional analysis with |
| >>> length = u.get_physical_type('length') | ||
| >>> time = u.get_physical_type('time') | ||
| >>> length ** 2 | ||
| PhysicalType({'area') |
There was a problem hiding this comment.
The curly bracket here causes the tests to fail...
|
As I did in perhaps a bad way, and @mhvk suggested an alternative in #11595, it would be great to also have a list of the valid physical types in the docs. I agree that @mhvk's proposal is more in line with current astropy conventions... No problems if you don't want to do it here, I'll tackle it at some point in #11595, but then it won't be in v4.3! |
never mind. @mhvk is tackling this already! |
Description
This pull request is to add narrative documentation on how to use the
PhysicalTypeinstances that were added in #11204.Fixes #11588.