Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want all the greatness of Makefiles without the painful syntax I can highly recommend Snakemake: https://snakemake.readthedocs.io/en/stable/

It has completely replaced Makefiles for me. It can be used to run shell commands just like make, but the fact that it is written in Python allows you to also run arbitrary Python code straight from the Makefile (Snakefile). So now instead of writing a command-line interface for each of my Python scripts, I can simply import the script in the Snakefile and call a function directly.

Eg.

  rule make_plot:
    input: data = "{name}.txt"
    output: plot = "{name}.png"
    run:
      import my_package
      my_package.plot(input['data'], output['plot'], name = wildcards['name'])
Another great feature is its integration with cluster engines like SGD/LSF, which means it can automatically submit jobs to the cluster instead of running them locally.


Wow. This project has probably the worst example of the telescoping constructor antipattern I've ever seen:

https://snakemake.readthedocs.io/en/stable/api_reference/sna...


It's Python, not Java, so it can't have the telescoping constructor anti-pattern.

Admittedly, there are a huge number of arguments to the snakefile constructor, but they are optional named arguments making the constructor safer and easier to use than Java's telescoping constructor and it alternatives (Java Bean pattern or builder patterns). This application apparently has many options or settings.


Looks like much more syntax to me, hence more painful.

Make, bsdmake and gmake syntax is minimal and precise enough.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: