diff --git a/pykat/finesse.py b/pykat/finesse.py index 147063d0e1bdbc7331bcf7175ecd816688ab109d..f442a719cb8d644dfe9b7f2b11f312921359cb3a 100644 --- a/pykat/finesse.py +++ b/pykat/finesse.py @@ -216,13 +216,19 @@ class BlockedKatFile(object): self.blocks = {self.__NO_BLOCK:""} self.__currentBlock = self.__NO_BLOCK - def remove(self, block): - if block not in self.ordering or block not in self.blocks: - raise Exception("%s block not found") - - self.ordering.remove(block) - self.blocks.pop(block) + def remove(self, *blocks): + if len(blocks[0]) > 1 and not isinstance(blocks[0], six.string_types): + # if we've got an iterable thing that isn't a string, eg list or tuple + # just use that + blocks = blocks[0] + for block in blocks: + if block not in self.ordering or block not in self.blocks: + raise Exception("%s block not found") + + self.ordering.remove(block) + self.blocks.pop(block) + def add(self, block, contents, addAfter=None): if block in self.ordering or block in self.blocks: diff --git a/pykat/optics/gaussian_beams.py b/pykat/optics/gaussian_beams.py index 1a1b534c415825c36f1cd51219678649f3e875c4..9467f349cf4198aee37b7e3b6adec1fa820f2377 100644 --- a/pykat/optics/gaussian_beams.py +++ b/pykat/optics/gaussian_beams.py @@ -14,11 +14,6 @@ from scipy.special import hermite from pykat.math.jacobi import jacobi from pykat.SIfloat import SIfloat -class gauss_param(BeamParam): - pass - -class beam_param(BeamParam): - pass class BeamParam(object): """ @@ -499,3 +494,13 @@ def LG2HG(p,l): coefficients[j] = c * (-1.0)**p * (-2)**j * jacobi(j,n-j,m-j,0.0) return coefficients, ns, ms + + +# These classes are here as legacy classes, BeamParam should throw a warning if they are used instead. + + +class gauss_param(BeamParam): + pass + +class beam_param(BeamParam): + pass \ No newline at end of file