Skip to content

Commit fda71b5

Browse files
committed
Cleanup namespace
1 parent 356dffc commit fda71b5

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

maps/python/skymapaddons.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import warnings
33
from . 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

6971
G3SkyMapWeights.keys = skymapweights_keys
70-
del skymapweights_keys
7172

7273
def 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

101102
G3SkyMapWeights.__getitem__ = skymapweights_getitem
102-
del skymapweights_getitem
103103

104104
def 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

128128
G3SkyMapWeights.__setitem__ = skymapweights_setitem
129-
del skymapweights_setitem
130129

131130
# patch handling for flat sky maps
132131
def skymapweights_extract(self, x0, y0, width, height, fill=0):
@@ -141,7 +140,6 @@ def skymapweights_extract(self, x0, y0, width, height, fill=0):
141140

142141
skymapweights_extract.__doc__ = FlatSkyMap.extract_patch.__doc__
143142
G3SkyMapWeights.extract_patch = skymapweights_extract
144-
del skymapweights_extract
145143

146144
def 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

156154
skymapweights_insert.__doc__ = FlatSkyMap.insert_patch.__doc__
157155
G3SkyMapWeights.insert_patch = skymapweights_insert
158-
del skymapweights_insert
159156

160157
def 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

170167
skymapweights_reshape.__doc__ = FlatSkyMap.reshape.__doc__
171168
G3SkyMapWeights.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))
185181
G3SkyMapWeights.__getattr__ = skymapweights_getattr
186-
del skymapweights_getattr
187182
oldsetattr = G3SkyMapWeights.__setattr__
188183
def 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)
204199
G3SkyMapWeights.__setattr__ = skymapweights_setattr
205-
del skymapweights_setattr
206200

207201
def 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))
211205
G3SkyMapMask.__getattr__ = skymapmask_getattr
212-
del skymapmask_getattr
213206

214207
def 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)
224217
G3SkyMap.Clone = skymap_clone
225218
G3SkyMapWeights.Clone = skymap_clone
226-
del skymap_clone
227219

228220
def skymap_compat(self, other):
229221
with warnings.catch_warnings():
@@ -236,4 +228,3 @@ def skymap_compat(self, other):
236228
)
237229
return self.compatible(other)
238230
G3SkyMap.IsCompatible = skymap_compat
239-
del skymap_compat

0 commit comments

Comments
 (0)