Source code for morse.modifiers.feet

import logging; logger = logging.getLogger("morse." + __name__)

from morse.modifiers.abstract_modifier import AbstractModifier

[docs]class FeetModifier(AbstractModifier): """ This modifier converts datas from imperial units to metrics units and vice-versa. The Feet modifier provides as modifiers: * :py:class:`morse.modifiers.feet.MeterToFeet` * :py:class:`morse.modifiers.feet.FeetToMeter` """ _name = "feet"
[docs] def initialize(self): self._coeff = 1.0
[docs] def modify(self): for key in {'x', 'y', 'z'}: if key in[key] *= self._coeff
[docs]class MeterToFeet(FeetModifier): """ Converts Meter (Morse) to Feet """
[docs] def initialize(self): self._coeff = 3.2808399
[docs]class FeetToMeter(FeetModifier): """ Converts Feet to Meter """
[docs] def initialize(self): self._coeff = 1/3.2808399