Skip to content

Association of units with physical types #23

@mhvk

Description

@mhvk

Over at astropy, we've been thinking a bit of how to associate physical types with units, in a way that is backward compatible. For defining units explicitly, this may be fairly obvious, just have an extra "physical_type" keyword argument, and likely that is all we would want to fix for interoperation.

But I thought it might be good to mention that we're also thinking about possible short-cuts in unit calculations. As an option, we're wondering about (see astropy/astropy#18521 (comment)) using __getitem__ as a way for the user to tell what the intended physical type is. E.g.,

s  = 1.23 * (u.J/u.K)["entropy"]
cv = 4.56 * (u.J/u.K)["heat capacity"]

Of course, another question is how this is used in actual calculations...

EDIT: Would be really happy to hear how other unit packages solve this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions