Industrial practices for increasing productivity in a small scientific environment

I work in a small independent scientific laboratory at a university in the United States, and I learned that compared to many practices that are supposedly followed in the industry, for example, daily checking in version control system, using a single IDE / editor for all languages ​​(for example , emacs) etc., we follow a pretty crappy programming practice.

So, I was going to collect all my programs, scripts, etc. and create a simplified environment for increased productivity. I would like suggestions from people in Qaru to be the same. Here is my basic plan: I use MATLAB, C, and Python scripts, and I would like to edit, compile them from one editor and ensure proper version control.

(questions / things for which I would like suggestions to be in italics)

1] Install Cygwin and get it to work with Windows, so I can use git or a similar version control system (is there a DVCS that can work directly from the CLI windows, so can I skip the Cygwin step?).

2] Configure emacs to work with C, Python and MATLAB files, so I can edit and compile all three times from one editor (for example, emacs)

(I'm not very familiar with the emacs menu, but is there a way to set the compiler path for certain languages? I know that Google can do this, but the emacs documentation is very hard for me to read far, so I would appreciate it if anyone then he told me in plain language)

3] Start checking the code at the end of every day or half a day to maintain the correct way to execute my code (two questions),

  • Can you check files directly from emacs?

  • Is there any way to check LabVIEW files in DVCS like git?

Finally, I would like to apologize for the rather vague nature of the question and I hope that I will learn to ask the best questions over time. I would appreciate it if people would give their suggestions and point out any resources that could help me study.

+7
scientific computing
source share
5 answers

1) Both git and mercurial will work under Windows initially - Cygwin is not needed - an environment that I would avoid if at all possible.

2) I don't understand why you think you need to use emacs.

3) You do not check the code at a certain time of the day or at a certain frequency - you register when you make a clear change, which has been checked and works. Or if you are in your branch when convenient.

+3
source share

It’s great that you are following this route. Here are a few things to add to this list:

1) Add testing to your work cycle. That is, as soon as a segment was written, other people who did not work on it, look at the code. Then write tests to make sure the new code integrates well with other code and gives the results you would like to see, and finally make these tests part of the nightly build process.

2) Complete the build process at night. Or at least some kind of automated process that rebuilds your code every time someone checks the code. Ask all your tests on this assembly.

+2
source share

Trying to follow some best practices will bring you many benefits, but you may find that many people are not very interested in following them. Try to advertise the benefits in a subtle way so as not to intimidate your colleagues - if they like what they see, they may eventually accept some of your offers.

The scientific environment, in which many people only care about ending up quickly or getting their funding offers, seems to impose a hit-n-rank, cowboy coding style. If you can make people think about quality and reproducibility, you have already won.

What I found useful:

  • Always try to break your code in small subprojects that you can easily check. Perform tests with every registration. You can use git submodules to build your "applications".
  • If several people can commit the repository, use something like astyle to have consistent formatting (perhaps less problems for Python code).
  • Set up something like gitweb / cgit / ... so that people can get tarballs of code and get used to the idea that source control is useful.
  • Try to find an interlocutor in your group / community. Code review is very difficult to do in an environment where people tend to β€œjust do it,” often throwing good style / common sense over the board.
+2
source share

As others noted, checking at regular intervals is not very important. Come in when you reach the milestone (you made changes that work with the rest of the code and they build correctly. Automated builds are much more important. They confirm that you have checked all the relevant changes.

I think you might be a little embarrassed about how to manage source code and clients for version control. Clients for CVS, SVN, Git and other users are almost universal for windows. Hosting is available on many web hosts. This might be a good option, as it will also effectively give you a backup copy of your codebase for $ 100 a year. Alternatively, you can simply download the server to a low PC and put it in some kind of cabinet, although the cost of electricity will probably be the same as what you pay for hosting.

Using a single IDE for all languages ​​is not important at all; consistency in projects of the same language is important. All of your projects in the same language should probably have a common coding standard. They should also be based on the same compiler and / or run on the same interpreter / virtual machine and have updated project files for any IDE used (if applicable).

0
source share

Is there any way to check LabVIEW files in DVCS like git?

There is no reason why LabVIEW files cannot be in DVCS, I use Mercurial. However, since LabVIEW files are considered binary files, the size of your repo will grow rapidly.

LabVIEW provides 3-way merges to use the diff function between the two versions that you need LV-diff , with a few settings to support tools that only change the location of files (e.g. duplicate file names).

It is also important to add * .lvlps and * .aliases to your ignore list; these files do not have useful value on another computer.

0
source share

All Articles