Skip to content

Injecting shorthands for the most usual units #20411

Open
@nthiery

Description

@nthiery

Implement inject_shorthands that would inject into the global name space shorthands for the most usual units::

    sage: units.inject_shorthands()
    sage: 3 * kg * m / s^2
    3*kilogram*meter/second^2

This can be implemented easily as in e.g. sage.combinat.sf.sf.SymmetricFunctions.inject_shorthands, together with a dictionary mapping shorthands to the corresponding units.

The main difficulty is to agree on a list of shorthands :-)

Let's start a list: s, mm, cm, m, km, g, kg, ...;
Maybe l, W, J, ...;
Maybe long names for the less usual units: ton, watt, ...

Or have something like:

    sage: sage.units.mass.inject_shorthands(all=True)

that injects all the units with their long names.

Component: symbolics

Issue created by migration from https://trac.sagemath.org/ticket/20411

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions