Odds and ends from my life as a grad student and official unofficial one-man IT department.
Showing posts with label code. Show all posts
Showing posts with label code. Show all posts
29 January 2013
Searching for NULL: Making hg and git recognize text as text.
Labels:
automation,
bash,
code,
git,
hg,
latex,
version control
Diffs for LaTeX in Version Control
I use Mercurial to track changes in my LaTeX documents. While there's latexdiff and the older texdiff to produce a conveniently marked up difference document (like Track Changes in Word or OpenOffice), those depend on having both versions available at the same time -- a bit of a pain when using version control. You have to update to the old version, rename it, update to the new version and then compare them -- far from trivial for documents with many files. Well, now there's a convenient utility to do that for you with Mercurial and Git, scm-latexdiff. Check it out.
06 October 2012
Best Software Practices for Science / Scientific Computing
I highly recommend this:
http://software-carpentry.org/2012/10/best-practices-for-scientific-computing/
The most important tips that I would like to see my own group use more of are (abridged from link):
http://software-carpentry.org/2012/10/best-practices-for-scientific-computing/
The most important tips that I would like to see my own group use more of are (abridged from link):
- version control (with modern DVCS, there's no reason not to have even your little scripts under version control)
- automate repetitive tasks and use the computer to record (command) history (I think these two really go hand in hand with each other and with #1)
- Don’t repeat yourself (or others).
- Every piece of data must have a single authoritative representation in the system.
- Code should be modularized rather than copied and pasted.
- Re-use code instead of rewriting it
Copy and pasting leads to the code blocs getting out of sync, i.e., inconsistent analyses. And I can't tell you the number of times I've found a mess of inconsistent scripts and literally hundreds of gigabytes of duplicated data, with no single copy "authoritative". (Luckily, in the last case, SHA1 revealed that the individual data files were identical; however, each set had a slightly different collection of files...). And if you do right from the beginning, it doesn't even take that much time!
I think all of this can be summarized into two points:
- Use version control
- Use good coding/documentation practices, including modularity
Subscribe to:
Posts (Atom)