How to use the plonk.units.define function in plonk

To help you get started, we’ve selected a few plonk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dmentipl / plonk / plonk / snap / units.py View on Github external
"""Physical units on snapshots."""

from .. import units as plonk_units
from .snap import SnapLike

# Add units
plonk_units.define('solar_mass = 1.9891e33 g')
plonk_units.define('solar_radius = 6.959500e10 cm')
plonk_units.define('earth_mass = 5.979e27 g')
plonk_units.define('earth_radius = 6.371315e8 cm')
plonk_units.define('jupiter_mass = 1.89813e30 g')


def generate_units_dictionary(length, mass, time, magnetic_field):
    """Generate units dictionary.

    Parameters
    ----------
    length
        Length unit as a Pint quantity.
    mass
        Mass unit as a Pint quantity.
    time
        Time unit as a Pint quantity.
    magnetic_field
        Magnetic field unit as a Pint quantity.
github dmentipl / plonk / plonk / snap / units.py View on Github external
"""Physical units on snapshots."""

from .. import units as plonk_units
from .snap import SnapLike

# Add units
plonk_units.define('solar_mass = 1.9891e33 g')
plonk_units.define('solar_radius = 6.959500e10 cm')
plonk_units.define('earth_mass = 5.979e27 g')
plonk_units.define('earth_radius = 6.371315e8 cm')
plonk_units.define('jupiter_mass = 1.89813e30 g')


def generate_units_dictionary(length, mass, time, magnetic_field):
    """Generate units dictionary.

    Parameters
    ----------
    length
        Length unit as a Pint quantity.
    mass
        Mass unit as a Pint quantity.
    time
github dmentipl / plonk / plonk / snap / units.py View on Github external
"""Physical units on snapshots."""

from .. import units as plonk_units
from .snap import SnapLike

# Add units
plonk_units.define('solar_mass = 1.9891e33 g')
plonk_units.define('solar_radius = 6.959500e10 cm')
plonk_units.define('earth_mass = 5.979e27 g')
plonk_units.define('earth_radius = 6.371315e8 cm')
plonk_units.define('jupiter_mass = 1.89813e30 g')


def generate_units_dictionary(length, mass, time, magnetic_field):
    """Generate units dictionary.

    Parameters
    ----------
    length
        Length unit as a Pint quantity.
    mass
        Mass unit as a Pint quantity.
    time
        Time unit as a Pint quantity.
    magnetic_field
github dmentipl / plonk / plonk / snap / units.py View on Github external
"""Physical units on snapshots."""

from .. import units as plonk_units
from .snap import SnapLike

# Add units
plonk_units.define('solar_mass = 1.9891e33 g')
plonk_units.define('solar_radius = 6.959500e10 cm')
plonk_units.define('earth_mass = 5.979e27 g')
plonk_units.define('earth_radius = 6.371315e8 cm')
plonk_units.define('jupiter_mass = 1.89813e30 g')


def generate_units_dictionary(length, mass, time, magnetic_field):
    """Generate units dictionary.

    Parameters
    ----------
    length
        Length unit as a Pint quantity.
    mass
        Mass unit as a Pint quantity.
    time
        Time unit as a Pint quantity.
    magnetic_field
        Magnetic field unit as a Pint quantity.
github dmentipl / plonk / plonk / snap / units.py View on Github external
"""Physical units on snapshots."""

from .. import units as plonk_units
from .snap import SnapLike

# Add units
plonk_units.define('solar_mass = 1.9891e33 g')
plonk_units.define('solar_radius = 6.959500e10 cm')
plonk_units.define('earth_mass = 5.979e27 g')
plonk_units.define('earth_radius = 6.371315e8 cm')
plonk_units.define('jupiter_mass = 1.89813e30 g')


def generate_units_dictionary(length, mass, time, magnetic_field):
    """Generate units dictionary.

    Parameters
    ----------
    length
        Length unit as a Pint quantity.
    mass
        Mass unit as a Pint quantity.
    time
        Time unit as a Pint quantity.