Skip to content
Snippets Groups Projects
Commit 2c40a2e4 authored by Andreas Freise's avatar Andreas Freise
Browse files

changing blocks to be an ordered dictionary, so that it presevers

the order in which blocks have been read in. Again, just for
making the kat files a bit more readable.
parent 46218f5a
Branches
No related tags found
No related merge requests found
...@@ -33,8 +33,9 @@ import pickle ...@@ -33,8 +33,9 @@ import pickle
import pykat import pykat
import warnings import warnings
import re import re
#import collections
from collections import namedtuple from collections import namedtuple, OrderedDict
from pykat.node_network import NodeNetwork from pykat.node_network import NodeNetwork
from pykat.detectors import Detector from pykat.detectors import Detector
...@@ -245,7 +246,7 @@ class kat(object): ...@@ -245,7 +246,7 @@ class kat(object):
self.scene = None # scene object for GUI self.scene = None # scene object for GUI
self.verbose = True self.verbose = True
self.__blocks = {} # dictionary of blocks that are used self.__blocks = OrderedDict() # dictionary of blocks that are used
self.__components = {} # dictionary of optical components self.__components = {} # dictionary of optical components
self.__detectors = {} # dictionary of detectors self.__detectors = {} # dictionary of detectors
self.__commands = {} # dictionary of commands self.__commands = {} # dictionary of commands
...@@ -857,7 +858,6 @@ class kat(object): ...@@ -857,7 +858,6 @@ class kat(object):
else: else:
out.append(txt + "\n") out.append(txt + "\n")
if self.scale != None and self.scale !='': out.append("scale {0}\n".format(self.scale)) if self.scale != None and self.scale !='': out.append("scale {0}\n".format(self.scale))
if self.phase != None: out.append("phase {0}\n".format(self.phase)) if self.phase != None: out.append("phase {0}\n".format(self.phase))
if self.maxtem != None: if self.maxtem != None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment