Skip to content

Research Software Development

leovsch edited this page Apr 9, 2024 · 8 revisions

Research software development best practices

So you want to develop convienient sofware tools to make your life easier as a researcher? Altough developing a small piece of software that does one task is very easy, developing software that is re-usable robust and has a high level of code quality might be a bit more challenging. Therefore to help you furhter in that process have a look at the following course:

  • Coderefinery offers a lot of lessons on various topics on research software development such as version control, automated testing, modular code development and writing documentation.

Usefull Python libraries

  • Pandas mainly used for data analysis e.g. reading and modifying excel files, vizualizing data and statistical operations.
  • Numpy provides different data structures such as multidimensional arrays, matrices and mathematical calculations such as fourier transforms, linear algebra and statistical operations.
  • Pypsa Power system analysis
  • PandaPower power system modeling, analysis and optimization
  • Nixtla ecosystem for time series.
  • Power Grid Model grid calculations.

Way of working within this Github organization

Getting Access to the repositories

This Github organizations contains nice tools that might help you with your research. For example it has a tool that helps you collect data from Entsoe and another tool that helps you collect data from KNMI. If you want to make use of one of the tools request access to its repository by asking one of the organization's owners. The idea is that you can then use the tool and contribute to the tool's development. Contributions can be very small or big and usually encompass one or more of the following activities:

  • Writing documentation
  • Opening/closing issues
  • Implementing new features
  • Reviewing pull requests
  • Writing tests

Building python projects

To build the python projects locally and be able to import them as a module run the following command inside the repository folder:

python -m pip install -e ./

Contributing code

When you want to develop new features for a tool feel free to create a new branch in its repository. Once you've finished your code changes follow the following steps to get the changes into the main branch:

  1. Create a pull request
  2. Let the pull request be reviewed by one of the repository's contributors
  3. Let the tests run (happens automatically upon creating a pull request)
  4. If the checks in step 2 and 3 pass complete the pull request

Creating a new repository

New repositories can be created as an empty project or with a template. Please refer to the below tutorials for creating new repositories.

Python projects

  1. Go to the Python-project-template repository
  2. In the top right corner press the "Use this template" button
  3. Press "Create a new repository"
  4. Continue from step 3 in the steps in other projects

Other projects

  1. Go to the Organization's home page
  2. In the right pane click "Create new repository"
  3. Fill in the repository details i.e. name, public/private repository and a description
  4. In the owner section change owner to "EES-TUe"
  5. Press the "Create repository" button at the bottom
  6. Continue with the steps in the all projects

All projects

  1. Go to settings
  2. Go to branches
  3. Press: "Add branch protection rule"
  4. In the "Branch name pattern" section fill in "main"
  5. Check the "Require a pull request before merging" check box
  6. Check the "Do not allow bypassing the above settings" check box
  7. Press the "create" button
  8. Add the new repository to the tool list in the wiki