LSST Applications g013ef56533+d2224463a4,g199a45376c+0ba108daf9,g19c4beb06c+9f335b2115,g1fd858c14a+2459ca3e43,g210f2d0738+2d3d333a78,g262e1987ae+abbb004f04,g2825c19fe3+eedc38578d,g29ae962dfc+0cb55f06ef,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+19c3a54948,g47891489e3+501a489530,g4cdb532a89+a047e97985,g511e8cfd20+ce1f47b6d6,g53246c7159+8c5ae1fdc5,g54cd7ddccb+890c8e1e5d,g5fd55ab2c7+951cc3f256,g64539dfbff+2d3d333a78,g67b6fd64d1+501a489530,g67fd3c3899+2d3d333a78,g74acd417e5+0ea5dee12c,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g89139ef638+501a489530,g8d7436a09f+5ea4c44d25,g8ea07a8fe4+81eaaadc04,g90f42f885a+34c0557caf,g9486f8a5af+165c016931,g97be763408+d5e351dcc8,gbf99507273+8c5ae1fdc5,gc2a301910b+2d3d333a78,gca7fc764a6+501a489530,gce8aa8abaa+8c5ae1fdc5,gd7ef33dd92+501a489530,gdab6d2f7ff+0ea5dee12c,ge410e46f29+501a489530,geaed405ab2+e3b4b2a692,gf9a733ac38+8c5ae1fdc5,w.2025.41
LSST Data Management Base Package
Loading...
Searching...
No Matches
lsst.sphgeom._continue_class Namespace Reference

Classes

class  Box
 
class  Circle
 
class  ConvexPolygon
 
class  Region
 

Functions

bool _isAttributeSafeToTransfer (str name, typing.Any value)
 
 _continueClass (cls)
 
float _inf_to_limit (float value, float min, float max)
 
float _inf_to_lat (float lat)
 
float _inf_to_lon (float lat)
 

Variables

 _INTRINSIC_SPECIAL_ATTRIBUTES
 

Detailed Description

Extend any of the C++ Python classes by adding additional methods.

Function Documentation

◆ _continueClass()

lsst.sphgeom._continue_class._continueClass ( cls)
protected

Definition at line 67 of file _continue_class.py.

67def _continueClass(cls):
68 orig = getattr(sys.modules[cls.__module__], cls.__name__)
69 for name in dir(cls):
70 # Common descriptors like classmethod and staticmethod can only be
71 # accessed without invoking their magic if we use __dict__; if we use
72 # getattr on those we'll get e.g. a bound method instance on the dummy
73 # class rather than a classmethod instance we can put on the target
74 # class.
75 attr = cls.__dict__.get(name, None) or getattr(cls, name)
76 if _isAttributeSafeToTransfer(name, attr):
77 setattr(orig, name, attr)
78 return orig
79
80

◆ _inf_to_lat()

float lsst.sphgeom._continue_class._inf_to_lat ( float lat)
protected
Map latitude +Inf to +90 and -Inf to -90 degrees.

Definition at line 90 of file _continue_class.py.

90def _inf_to_lat(lat: float) -> float:
91 """Map latitude +Inf to +90 and -Inf to -90 degrees."""
92 return _inf_to_limit(lat, -90.0, 90.0)
93
94

◆ _inf_to_limit()

float lsst.sphgeom._continue_class._inf_to_limit ( float value,
float min,
float max )
protected
Map a value to a fixed range if infinite.

Definition at line 81 of file _continue_class.py.

81def _inf_to_limit(value: float, min: float, max: float) -> float:
82 """Map a value to a fixed range if infinite."""
83 if not math.isinf(value):
84 return value
85 if value > 0.0:
86 return max
87 return min
88
89

◆ _inf_to_lon()

float lsst.sphgeom._continue_class._inf_to_lon ( float lat)
protected
Map longitude +Inf to +360 and -Inf to 0 degrees.

Definition at line 95 of file _continue_class.py.

95def _inf_to_lon(lat: float) -> float:
96 """Map longitude +Inf to +360 and -Inf to 0 degrees."""
97 return _inf_to_limit(lat, 0.0, 360.0)
98
99
100@_continueClass

◆ _isAttributeSafeToTransfer()

bool lsst.sphgeom._continue_class._isAttributeSafeToTransfer ( str name,
typing.Any value )
protected

Definition at line 59 of file _continue_class.py.

59def _isAttributeSafeToTransfer(name: str, value: typing.Any) -> bool:
60 if name.startswith("__") and (
61 value is getattr(object, name, None) or name in _INTRINSIC_SPECIAL_ATTRIBUTES
62 ):
63 return False
64 return True
65
66

Variable Documentation

◆ _INTRINSIC_SPECIAL_ATTRIBUTES

lsst.sphgeom._continue_class._INTRINSIC_SPECIAL_ATTRIBUTES
protected
Initial value:
1= frozenset(
2 (
3 "__qualname__",
4 "__module__",
5 "__metaclass__",
6 "__dict__",
7 "__weakref__",
8 "__class__",
9 "__subclasshook__",
10 "__name__",
11 "__doc__",
12 )
13)

Definition at line 44 of file _continue_class.py.