22import warnings
33from . import G3SkyMapWeights , G3SkyMap , FlatSkyMap , G3SkyMapMask
44
5+ __all__ = []
6+
57# This file adds extra functionality to the python interface to G3SkyMap and
68# G3SkyMapWeights. This is done in ways that exploit a large fraction of
79# the evil things you can do in Python (Nick referred to it as "devil magic"),
@@ -67,7 +69,6 @@ def skymapweights_keys(self):
6769 return ['TT' ]
6870
6971G3SkyMapWeights .keys = skymapweights_keys
70- del skymapweights_keys
7172
7273def skymapweights_getitem (self , x ):
7374 if isinstance (x , str ) and x in self .keys ():
@@ -99,7 +100,6 @@ def skymapweights_getitem(self, x):
99100 return mat
100101
101102G3SkyMapWeights .__getitem__ = skymapweights_getitem
102- del skymapweights_getitem
103103
104104def skymapweights_setitem (self , x , mat ):
105105 if isinstance (x , str ) and x in self .keys ():
@@ -126,7 +126,6 @@ def skymapweights_setitem(self, x, mat):
126126 self .UU [x ] = mat [2 ,2 ]
127127
128128G3SkyMapWeights .__setitem__ = skymapweights_setitem
129- del skymapweights_setitem
130129
131130# patch handling for flat sky maps
132131def skymapweights_extract (self , x0 , y0 , width , height , fill = 0 ):
@@ -141,7 +140,6 @@ def skymapweights_extract(self, x0, y0, width, height, fill=0):
141140
142141skymapweights_extract .__doc__ = FlatSkyMap .extract_patch .__doc__
143142G3SkyMapWeights .extract_patch = skymapweights_extract
144- del skymapweights_extract
145143
146144def skymapweights_insert (self , weights_patch , ignore_zeros = False ):
147145 if not isinstance (self .TT , FlatSkyMap ):
@@ -155,7 +153,6 @@ def skymapweights_insert(self, weights_patch, ignore_zeros=False):
155153
156154skymapweights_insert .__doc__ = FlatSkyMap .insert_patch .__doc__
157155G3SkyMapWeights .insert_patch = skymapweights_insert
158- del skymapweights_insert
159156
160157def skymapweights_reshape (self , width , height , fill = 0 ):
161158 if not isinstance (self .TT , FlatSkyMap ):
@@ -169,7 +166,6 @@ def skymapweights_reshape(self, width, height, fill=0):
169166
170167skymapweights_reshape .__doc__ = FlatSkyMap .reshape .__doc__
171168G3SkyMapWeights .reshape = skymapweights_reshape
172- del skymapweights_reshape
173169
174170# Pass through attributes to submaps. This is not ideal because the properties
175171# are hidden and not visible by tab completion. A better solution would use
@@ -183,7 +179,6 @@ def skymapweights_getattr(self, x):
183179 return getattr (self .TT , x )
184180 raise AttributeError ("'{}' object has no attribute '{}'" .format (type (self ), x ))
185181G3SkyMapWeights .__getattr__ = skymapweights_getattr
186- del skymapweights_getattr
187182oldsetattr = G3SkyMapWeights .__setattr__
188183def skymapweights_setattr (self , x , val ):
189184 try :
@@ -202,14 +197,12 @@ def skymapweights_setattr(self, x, val):
202197 if self .UU is not None :
203198 setattr (self .UU , x , val )
204199G3SkyMapWeights .__setattr__ = skymapweights_setattr
205- del skymapweights_setattr
206200
207201def skymapmask_getattr (self , x ):
208202 if hasattr (self .parent , x ):
209203 return getattr (self .parent , x )
210204 raise AttributeError ("'{}' object has no attribute '{}'" .format (type (self ), x ))
211205G3SkyMapMask .__getattr__ = skymapmask_getattr
212- del skymapmask_getattr
213206
214207def skymap_clone (self , copy_data = True ):
215208 with warnings .catch_warnings ():
@@ -223,7 +216,6 @@ def skymap_clone(self, copy_data=True):
223216 return self .clone (copy_data )
224217G3SkyMap .Clone = skymap_clone
225218G3SkyMapWeights .Clone = skymap_clone
226- del skymap_clone
227219
228220def skymap_compat (self , other ):
229221 with warnings .catch_warnings ():
@@ -236,4 +228,3 @@ def skymap_compat(self, other):
236228 )
237229 return self .compatible (other )
238230G3SkyMap .IsCompatible = skymap_compat
239- del skymap_compat
0 commit comments