Commit b57a16af authored by Daniel Brown's avatar Daniel Brown
Browse files

fixing ordering. Adding more intelligent remove in BlockedKatFile

parent 4081eabd
Pipeline #1762 passed with stage
in 19 seconds
......@@ -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:
......
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment