Package pygeodesy :: Module named :: Class _NamedTuple |
[frames] | no frames]

# Class _NamedTuple

    object --+
             |
         tuple --+
                 |
    object --+   |
             |   |
        _Named --+
                 |
                _NamedTuple

Known Subclasses:
  - ltpTuples.Aer4Tuple
  - , albers.Albers7Tuple
  - , ltpTuples.Attitude4Tuple
  - , azimuthal.Azimuthal7Tuple
  - , namedTuples.Bearing2Tuple
  - , namedTuples.Bounds2Tuple
  - , namedTuples.Bounds4Tuple
  - , vector2d.Circin6Tuple
  - , ellipsoids.Circle4Tuple
  - , vector2d.Circum3Tuple
  - , vector2d.Circum4Tuple
  - , deprecated.ClipCS3Tuple
  - , clipy.ClipCS4Tuple
  - , clipy.ClipLB6Tuple
  - , clipy.ClipSH3Tuple
  - , resections.Collins5Tuple
  - , ellipsoids.Curvature2Tuple
  - , namedTuples.Destination2Tuple
  - , namedTuples.Destination3Tuple
  - , karney._GTuple
  - , namedTuples.Distance2Tuple
  - , namedTuples.Distance3Tuple
  - , namedTuples.Distance4Tuple
  - , namedTuples.EasNor2Tuple
  - , namedTuples.EasNor3Tuple
  - , css.EasNorAziRk4Tuple
  - , etm.EasNorExact4Tuple
  - , webmercator.EasNorRadius3Tuple
  - , ecef.Ecef9Tuple
  - , ecef.EcefMatrix
  - , elevations.Elevation2Tuple
  - , elliptic.Elliptic3Tuple
  - , ltpTuples.Enu4Tuple
  - , ltpTuples.Footprint5Tuple
  - , frechet.Frechet6Tuple
  - , fsums.Fsum2Tuple
  - , elevations.GeoidHeight2Tuple
  - , geoids.GeoidHeight5Tuple
  - , hausdorff.Hausdorff6Tuple
  - , namedTuples.Intersection3Tuple
  - , namedTuples.LatLon2Tuple
  - , namedTuples.LatLon3Tuple
  - , namedTuples.LatLon4Tuple
  - , css.LatLonAziRk4Tuple
  - , namedTuples.LatLonDatum3Tuple
  - , namedTuples.LatLonDatum5Tuple
  - , etm.LatLonExact4Tuple
  - , namedTuples.LatLonPrec3Tuple
  - , namedTuples.LatLonPrec5Tuple
  - , ltpTuples.Local9Tuple
  - , vector2d.Meeus2Tuple
  - , mgrs.Mgrs4Tuple
  - , mgrs.Mgrs6Tuple
  - , namedTuples.NearestOn2Tuple
  - , namedTuples.NearestOn3Tuple
  - , namedTuples.NearestOn5Tuple
  - , namedTuples.NearestOn6Tuple
  - , namedTuples.NearestOn8Tuple
  - , ltpTuples.Ned3Tuple
  - , ltpTuples.Ned4Tuple
  - , namedTuples.PhiLam2Tuple
  - , namedTuples.PhiLam3Tuple
  - , namedTuples.PhiLam4Tuple
  - , namedTuples.Point3Tuple
  - , namedTuples.Points2Tuple
  - , formy.Radical2Tuple
  - , vector2d.Radii11Tuple
  - , geohash.Resolutions2Tuple
  - , points.Shape2Tuple
  - , vector2d.Soddy4Tuple
  - , resections.Survey3Tuple
  - , resections.Tienstra7Tuple
  - , trf.Transform7Tuple
  - , resections.TriAngle4Tuple
  - , resections.TriSide2Tuple
  - , resections.TriSide4Tuple
  - , namedTuples.Triangle7Tuple
  - , namedTuples.Triangle8Tuple
  - , namedTuples.Trilaterate5Tuple
  - , namedTuples.UtmUps2Tuple
  - , deprecated.UtmUps4Tuple
  - , namedTuples.UtmUps5Tuple
  - , namedTuples.UtmUps8Tuple
  - , namedTuples.UtmUpsLatLon5Tuple
  - , namedTuples.Vector2Tuple
  - , namedTuples.Vector3Tuple
  - , namedTuples.Vector4Tuple
  - , ltpTuples.Xyz4Tuple
  - , ellipsoids.a_f2Tuple

(INTERNAL) Base for named `tuple`s with both index and attribute name access to the items.

Note: This class is similar to Python's `namedtuple`, but statically defined, lighter and limited.

Instance Methods
__delattr__(self, name) Delete an attribute by `name`. |
__getattr__(self, name) Get the value of an attribute or item by `name`. |
__getitem__(self, item) Get the value of an item by `index`. |
__repr__(self) Default `repr(self)`. |
__setattr__(self, name, value) Set attribute or item `name` to `value`. |
__str__(self) Default `repr(self)`. |
dup(self, name='', **items) Duplicate this tuple replacing one or more items. |
items(self) Yield the items, each as a `(name, value)` pair (`2-tuple`). |
iteritems(self) Yield the items, each as a `(name, value)` pair (`2-tuple`). |
iterunits(self, Error=<class 'pygeodesy.errors.UnitError'>) Yield the items, each as a `(name, value`) pair (`2-tuple`) with the value wrapped as an instance of its units class. |
toRepr(self, prec=6, sep=', ', fmt='F', **unused) Return this `Named-Tuple` items as `name=value` string(s). |
toStr(self, prec=6, sep=', ', fmt='F', **unused) Return this `Named-Tuple` items as string(s). |
toUnits(self, Error=<class 'pygeodesy.errors.UnitError'>) Return a copy of this `Named-Tuple` with each item value wrapped as an instance of its units class. |
units(self, Error=<class 'pygeodesy.errors.UnitError'>) Yield the items, each as a `(name, value`) pair (`2-tuple`) with the value wrapped as an instance of its units class. |
Inherited from `tuple`: `__add__`, `__contains__`, `__eq__`, `__ge__`, `__getattribute__`, `__getnewargs__`, `__getslice__`, `__gt__`, `__hash__`, `__iter__`, `__le__`, `__len__`, `__lt__`, `__mul__`, `__ne__`, `__rmul__`, `count`, `index` Inherited from `_Named`: `__imatmul__`, `__matmul__`, `__rmatmul__`, `attrs`, `classof`, `copy`, `rename`, `toStr2` Inherited from `object`: `__format__`, `__init__`, `__reduce__`, `__reduce_ex__`, `__sizeof__`, `__subclasshook__`

Static Methods
a new object with type S, a subtype of T |
__new__(cls, arg, *args, **name_only) New _NamedTuple initialized with `positional` arguments. |

Properties
| iteration Get the iteration number (`int`) or `None` if not available/applicable.
Inherited from `_Named`: `classname`, `classnaming`, `name`, `named`, `named2`, `named3`, `named4` Inherited from `object`: `__class__`

Method Details

### __delattr__ (self, name) |
Delete an attribute by `name`. Overrides: object.__delattr__ Note: Items can not be deleted.

### __getitem__ (self, item) (Indexing operator) |
Get the value of an item by `index`. Overrides: tuple.__getitem__

### __new__ (cls, arg, *args, **name_only) Static Method |
New _NamedTuple initialized with `positional` arguments. Arguments: `arg` - Tuple items (`tuple`, `list`, ...) or first tuple item of several more in other positional arguments. `args` - Tuple items (`any`), all positional arguments. `name_only` - Only `name='name'` is used, all other keyword arguments are silently ignored. Returns: a new object with type S, a subtype of T Raises: `LenError` - Unequal number of positional arguments and number of item `_Names_` or `_Units_`. `TypeError` - The `_Names_` or `_Units_` attribute is not a `tuple` of at least 2 items. `ValueError` - Item name is not a `str` or valid `identifier` or starts with `underscore`. Overrides: object.__new__

### __repr__ (self) (Representation operator) |
Default `repr(self)`. Overrides: object.__repr__

### __setattr__ (self, name, value) |
Set attribute or item `name` to `value`. Overrides: object.__setattr__

### __str__ (self) (Informal representation operator) |
Default `repr(self)`. Overrides: object.__str__

### dup (self, name='', **items) |
Duplicate this tuple replacing one or more items. Arguments: `name` - Optional new name (`str`). `items` - Items to be replaced (`name=value` pairs), if any. Returns: A copy of this tuple with `items`. Raises: `NameError` - Some `items` invalid. Overrides: _Named.dup

### items (self) |
Yield the items, each as a `(name, value)` pair (`2-tuple`). See Also: Method `.units`.

### iteritems (self) |
Yield the items, each as a `(name, value)` pair (`2-tuple`). See Also: Method `.units`.

### iterunits (self, Error=<class 'pygeodesy.errors.UnitError'>) |
Yield the items, each as a `(name, value`) pair (`2-tuple`) with the value wrapped as an instance of its units class. Arguments: `Error` - Error to raise for units issues (`UnitError`). Raises: `Error` - Invalid `Named-Tuple` item or units class. See Also: Method `.items`.

### toRepr (self, prec=6, sep=', ', fmt='F', **unused) |
Return this `Named-Tuple` items as `name=value` string(s). Arguments: `prec` - The `float` precision, number of decimal digits (0..9). Trailing zero decimals are stripped for `prec` values of 1 and above, but kept for negative `prec` values. `sep` - Separator to join (`str`). `fmt` - Optional, `float` format (`str`). Returns: Tuple items (`str`). Overrides: _Named.toRepr

### toStr (self, prec=6, sep=', ', fmt='F', **unused) |
Return this `Named-Tuple` items as string(s). Arguments: `prec` - The `float` precision, number of decimal digits (0..9). Trailing zero decimals are stripped for `prec` values of 1 and above, but kept for negative `prec` values. `sep` - Separator to join (`str`). `fmt` - Optional `float` format (`str`). Returns: Tuple items (`str`). Overrides: _Named.toStr

### toUnits (self, Error=<class 'pygeodesy.errors.UnitError'>) |
Return a copy of this `Named-Tuple` with each item value wrapped as an instance of its units class. Arguments: `Error` - Error to raise for units issues (`UnitError`). Returns: A duplicate of this `Named-Tuple` (``Named-Tuple``). Raises: `Error` - Invalid `Named-Tuple` item or units class.

### units (self, Error=<class 'pygeodesy.errors.UnitError'>) |
Yield the items, each as a `(name, value`) pair (`2-tuple`) with the value wrapped as an instance of its units class. Arguments: `Error` - Error to raise for units issues (`UnitError`). Raises: `Error` - Invalid `Named-Tuple` item or units class. See Also: Method `.items`.

Property Details

### iteration Get the iteration number (`int`) or `None` if not available/applicable. Get method: iteration(self) - Get the iteration number (`int`) or `None` if not available/applicable. Set method: _fset_error(inst, val) - Throws an `AttributeError`, always. Delete Method: _fdel(inst) - Zap the cached/memoized `property` value.