sort dpoints keys
authorJacob Lifshay <programmerjake@gmail.com>
Fri, 15 Oct 2021 03:27:42 +0000 (20:27 -0700)
committerJacob Lifshay <programmerjake@gmail.com>
Fri, 15 Oct 2021 03:27:42 +0000 (20:27 -0700)
src/ieee754/part/layout_experiment.py

index 88f058cd5796bc24b017b0798506da65fc95f44a..65fe1425a46605e269a7f43e93ad13f9428307dc 100644 (file)
@@ -152,10 +152,13 @@ def layout(elwid, vec_el_counts, lane_shapes=None, fixed_width=None):
     # do not need the breakpoints at the very start or the very end
     dpoints.pop(0, None)
     dpoints.pop(width, None)
+
+    # sort dpoints keys
+    dpoints = dict(sorted(dpoints.items(), key=lambda i: i[0]))
+
     plist = list(dpoints.keys())
-    plist.sort()
     print("dpoints")
-    pprint(dict(dpoints))
+    pprint(dpoints)
 
     # second stage, add (map to) the elwidth==i expressions.
     # TODO: use nmutil.treereduce?