ruffus

30 thoughts
last posted Dec. 18, 2012, 9:22 p.m.

14 earlier thoughts

0

First step is going to be pulling out:

@ruffus.transform(split_polynomials_list, ruffus.suffix(".poly"), ".roots")
def roots_for_poly_chunks(input_filename, output_filename):
polys = open(input_filename, "rb").readlines()
with open(output_filename, "wb") as fp:
for line in polys:
roots = numpy.roots([1] + [int(x) for x in line.strip().split()])
for root in roots:
if root.real >= 0 and root.imag >= 0:
if not INNER_ONLY or abs(root) <= 1:
fp.write("{} {}\n".format(root.real, root.imag))
view raw ruffus.py hosted with ❤ by GitHub

Into a stand alone script and then replace the internals of that function with a SAGA execution of that new script.

15 later thoughts