Package pygeodesy :: Module interns
[frames] | no frames]

Module interns

Single-instance float and string constants, intern'ed across pygeodesy modules.

Functions pygeodesy.float_ and pygeodesy.machine.


Version: 22.08.16

Classes
  Str_
Extended, callable str class, not nameable.
Functions
 
float_(*fs, **sets)
Get scalars as float or intern float.
 
machine()
Return standard platform.machine, but distinguishing Intel native from Intel emulation on Apple Silicon (on macOS only).
Variables
  PI = 3.14159265359
  NN = ''
  DIG = 15
  EPS = 2.22044604925e-16
  MANT_DIG = 53
  MAX = 1.79769313486e+308
  MIN = 2.22507385851e-308
  EPS0 = 4.93038065763e-32
  EPS02 = 2.43086534291e-63
  EPS_2 = 1.11022302463e-16
  EPS1 = 1.0
  EPS2 = 4.4408920985e-16
  EPS4 = 8.881784197e-16
  INF = inf
  NAN = nan
  INT0 = 0
  NEG0 = -0.0
  NINF = -inf
  PI2 = 6.28318530718
  PI_2 = 1.57079632679
  PI3 = 9.42477796077
  PI3_2 = 4.71238898038
  PI4 = 12.5663706144
  PI_4 = 0.785398163397
  MANTIS = 53
Function Details

float_ (*fs, **sets)

 

Get scalars as float or intern float.

Arguments:
  • fs - One more values (scalar), all positional.
  • sets - Use keyword argument sets=True to intern each fs, otherwise don't.
Returns:
Single float if only one fs is given, otherwise a tuple of floats.
Raises:
  • TypeError - Some fs not scalar.

machine()

 

Return standard platform.machine, but distinguishing Intel native from Intel emulation on Apple Silicon (on macOS only).

Returns:
Machine 'arm64' for Apple Silicon native, 'x86_64' for Intel native, "arm64_x86_64" for Intel emulation, etc. (str with commas replaced by underscores).