Talk Set up a workflow for scientific figures using a python tool: waf


From teaching to research, the production of documents is ubiquitous and quite independant of the scientific domain: exams, reports, abstracts, thesis, projects or slides are common examples. During this production, we can distinguish the text writing itself and the creation of figures. Since there is a strong dependance between the text and the figures, the writer generally goes back and forth to make a full integration of figures in the final document. This process could be painful, time consuming and strongly affect the performance. For these reasons, modify and generate a figure to the usable format must be done quickly and efficiently. The goal is to minimize steps to edit, build and install figures to the correct path.

The solution I present here is the set up of a workflow. The aim is to be lightwight, support parralel builds and standart targets like configure, build, install, uninstall, clean...

Firstly, this requires a reflexion on involved technologies and file formats. A large variety of figures could be encountered such as drawings, chemical formulae, plots, plots including pictures or drawings... and interesting outputs are tex, eps, pdf, svg, etc. Though Tikz, I have chosen LATEX for the high quality and for automatization purpose. Moreover, figures are generally used in several documents which could be in different languages. An efficient translation of figures is managed via a centralized .po file avoiding redundant translations.

Secondly, the fact is that there is numerous inputs and outputs. Generally, several unitary convertion tools have to be written. Then, they are called by a build tool which deals with dependances and avoid unecessary compilations.

I will show that these two sides could be achieved at once with a build automation tool written in python: waf. This choice is motivated by the homegeneity of the resulting solution, the flexibility for future modifications and because no extra-language learning is needed: scripts are python modules!

Beyond this pratical application, such problematics could be of interrest to people who faces redondant tasks in different situations. I will present how it is easy to automate tasks in our favorite language.

tagged by
no related entity