Skip to content

Make PhysicalType instances support string methods with deprecation warnings #11617

Description

@namurphy

Description

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!

Metadata

Metadata

Assignees

Labels

Affects-devPRs and issues that do not impact an existing Astropy releaseunits

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions