Noted some suggested TODOs

Thu, 25 Apr 2013 11:43:16 +0200

author
Andy Buckley <andy@insectnation.org>
date
Thu, 25 Apr 2013 11:43:16 +0200
changeset 188
e706e3b2a647
parent 187
7fb3ad4184b2
child 189
60c73b489420

Noted some suggested TODOs

pyslha.py file | annotate | diff | comparison | revisions
     1.1 --- a/pyslha.py	Mon Apr 08 17:29:57 2013 +0200
     1.2 +++ b/pyslha.py	Thu Apr 25 11:43:16 2013 +0200
     1.3 @@ -18,6 +18,8 @@
     1.4  user-tweaking of the generated output.
     1.5  
     1.6  TODOs:
     1.7 + * Opportunistically use ordereddict to preserve write order
     1.8 + * Preserve comments from read -> write (needs full-line/inline comment separation?)
     1.9   * Split writeSLHA into writeSLHA{Blocks,Decays}
    1.10   * Identify HERWIG decay matrix element to use in ISAWIG
    1.11   * Handle RPV SUSY in ISAWIG
    1.12 @@ -65,7 +67,7 @@
    1.13      """
    1.14      def __init__(self, name, q=None):
    1.15          self.name = name
    1.16 -        self.entries = {}
    1.17 +        self.entries = {} # TODO: Use ordereddict?
    1.18          self.q = _autotype(q)
    1.19  
    1.20      def add_entry(self, entry):
    1.21 @@ -78,7 +80,7 @@
    1.22          #print "out", entry
    1.23          for e in entry[:-2]:
    1.24              if e is not entry[-1]:
    1.25 -                nextparent = nextparent.setdefault(e, {})
    1.26 +                nextparent = nextparent.setdefault(e, {}) # TODO: Use ordereddict?
    1.27          nextparent[entry[-2]] = entry[-1]
    1.28          #print self.entries
    1.29  
    1.30 @@ -179,8 +181,8 @@
    1.31      If the ignorenobr parameter is True, do not store decay entries with a
    1.32      branching ratio of zero.
    1.33      """
    1.34 -    blocks = {}
    1.35 -    decays = {}
    1.36 +    blocks = {} # TODO: Use ordereddict?
    1.37 +    decays = {} # TODO: Use ordereddict?
    1.38      #
    1.39      import re
    1.40      currentblock = None
    1.41 @@ -260,7 +262,7 @@
    1.42      sep = "   "
    1.43      out = ""
    1.44      def dict_hier_strs(d, s=""):
    1.45 -        if type(d) is dict:
    1.46 +        if type(d) is dict: # TODO: Use ordereddict?
    1.47              for k, v in sorted(d.iteritems()):
    1.48                  for s2 in dict_hier_strs(v, s + sep + _autostr(k)):
    1.49                      yield s2
    1.50 @@ -508,8 +510,8 @@
    1.51      branching ratio of zero.
    1.52      """
    1.53  
    1.54 -    blocks = {}
    1.55 -    decays = {}
    1.56 +    blocks = {} # TODO: Use ordereddict?
    1.57 +    decays = {} # TODO: Use ordereddict?
    1.58      LINES = isastr.splitlines()
    1.59  
    1.60      def getnextvalidline():

mercurial