Make PhysicalType instances support string methods with deprecation warnings
See original GitHub issueDescription
Prior to #11204, the physical_type
attribute of units was a string with the name of the unit. #11204 transformed the physical_type
attribute into instances of the new PhysicalType
class. #11204 did preserve much of the behavior of the string API (such as having ==
work between PhysicalType
instances and strings), but there were a few ways that it did not. A few of these ways are being discussed in #11204 starting with this comment. A lot of this could probably be done with this suggestion from @mhvk.
Suggestions on specific string behaviors to include and test for would be appreciated!
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
astropy/CHANGES.rst at main - GitHub
Trying to create an instance of astropy.coordinates. ... PhysicalType class instead of strings and the function astropy.units.physical.get_physical_type can ...
Read more >Full Changelog — Astropy v3.2.dev994
The astropy.io.fits.new_table function is now fully deprecated (though will not be removed for a long time, considering how widely it is used). Instead...
Read more >python-astropy-4.0.2-bp153.1.10 - SUSE Package Hub
(read|write).help when reader or writer has no docstring. ... New deprecation warnings from numpy 1.19 started to fail the test multibuild again.
Read more >Astropy Deprecation Warning - python - Stack Overflow
The easiest way to get rid of the warning is to simply remove the ~/.astropy/config/astropy.cfg file, if you have not edited it before....
Read more >Full Changelog — Astropy v0.4.2 - The University of Texas at Austin
[#2917]; Ensure numpy master is supported, by making np.cbrt work with ... Restored missing information from deprecation warning messages from the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the reminder! I completely forgot I raised this issue. Yep, #11625 will fix this.
The trouble is worth it though. Units and physical types are extremely hard to get right and the astropy approach of taking it one step at a time is great. And every change will break someone’s workflow.
We use the physical type to determine whether a value is an integrated flux or a flux density, #11204 seems to be a step in the right direction to do this properly through dimensional analysis. So thank you!