Loading [MathJax]/extensions/tex2jax.js
LSST Applications g0f08755f38+9522ef2f0f,g1653933729+a905cd61c3,g168dd56ebc+a905cd61c3,g1a2382251a+910d683904,g20f6ffc8e0+9522ef2f0f,g217e2c1bcf+f4af07de8a,g28da252d5a+26a25b978d,g2bbee38e9b+cc7bbd92cc,g2bc492864f+cc7bbd92cc,g32e5bea42b+de24d92311,g347aa1857d+cc7bbd92cc,g35bb328faa+a905cd61c3,g3a166c0a6a+cc7bbd92cc,g3bd4b5ce2c+02735527dc,g3e281a1b8c+2bff41ced5,g414038480c+4de324692b,g41af890bb2+4fc8c6ef01,g43bc871e57+d0d7cc457a,g78460c75b0+4ae99bb757,g80478fca09+615987a4d7,g82479be7b0+970d1d03ea,g8365541083+a905cd61c3,g858d7b2824+9522ef2f0f,g9125e01d80+a905cd61c3,ga5288a1d22+9ad990292e,gb58c049af0+84d1b6ec45,gc28159a63d+cc7bbd92cc,gc5452a3dca+b82ec7cc4c,gcab2d0539d+475d436cbd,gcf0d15dbbd+d816b8a730,gda6a2b7d83+d816b8a730,gdaeeff99f8+686ef0dd99,ge79ae78c31+cc7bbd92cc,gef2f8181fd+c1889b0e42,gf0baf85859+f9edac6842,gf1e97e5484+a55c27affc,gfa517265be+9522ef2f0f,gfa999e8aa5+d85414070d,w.2025.01
LSST Data Management Base Package
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Classes | Functions | Variables
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.