LSST Applications g00d0e8bbd7+8c5ae1fdc5,g013ef56533+603670b062,g083dd6704c+2e189452a7,g199a45376c+0ba108daf9,g1c5cce2383+bc9f6103a4,g1fd858c14a+cd69ed4fc1,g210f2d0738+c4742f2e9e,g262e1987ae+612fa42d85,g29ae962dfc+83d129e820,g2cef7863aa+aef1011c0b,g35bb328faa+8c5ae1fdc5,g3fd5ace14f+5eaa884f2a,g47891489e3+e32160a944,g53246c7159+8c5ae1fdc5,g5b326b94bb+dcc56af22d,g64539dfbff+c4742f2e9e,g67b6fd64d1+e32160a944,g74acd417e5+c122e1277d,g786e29fd12+668abc6043,g87389fa792+8856018cbb,g88cb488625+47d24e4084,g89139ef638+e32160a944,g8d7436a09f+d14b4ff40a,g8ea07a8fe4+b212507b11,g90f42f885a+e1755607f3,g97be763408+34be90ab8c,g98df359435+ec1fa61bf1,ga2180abaac+8c5ae1fdc5,ga9e74d7ce9+43ac651df0,gbf99507273+8c5ae1fdc5,gc2a301910b+c4742f2e9e,gca7fc764a6+e32160a944,gd7ef33dd92+e32160a944,gdab6d2f7ff+c122e1277d,gdb1e2cdc75+1b18322db8,ge410e46f29+e32160a944,ge41e95a9f2+c4742f2e9e,geaed405ab2+0d91c11c6d,w.2025.44
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.