Skip to content
Bjoern Ludwig edited this page Feb 6, 2022 · 34 revisions

Welcome to the Met4FoF code wiki!

Met4FoF logo

Introduction

Here you will be provided additional information around code writing and development in the EMPIR project 17IND12 Met4FoF.

On the following pages, you will find step-by-step instructions for a quick start working with the project's code and useful links to help you on your way with Git and other mandatory tools for the software development in the project.

Step-by-step guide

We start with the installation of the mandatory tools and then install and configure the recommended tools to work with the code.

Install Git

The installation of Git for all platforms is very well described here.

Install Git Client (optional)

The installation of a sophisticated Git GUI can drastically simplify the work with Git. An overview of available software is provided here. We made very good experiences with

Later in this step-by-step guide we will use PyCharm to execute the code and work on it, so you might want to try it, although the other two are even more intuitive and actually more powerful.

Create local copy of the repository

Once Git is installed, you are ready to create a local copy of the repository and take a first glance at the code.

Install Miniconda

We need a current Python distribution and in this guide use Miniconda, a slimmed down version of Anaconda, to create a flexible and updateable runtime environment for Python.

There are excellent installation instructions in the official docs. If you are running Windows and prompted during the installation whether Miniconda shall be your default Python installation, you should answer yes if you want to use PyCharm later as we recommend.

In case you already have a current Python implementation running you could skip this step.

Create a virtual environment

We then create a virtual environment with Miniconda (alternatively using pip) to provide the currently needed packages of our project's code.

Ready for CLI executions

On the command line we can then execute all parts of the project code and of course, could use any tool we are used to for further development.

Prepare an IDE

To work on the code, we recommend installing the IDE PyCharm Community Edition, because it offers excellent integration of virtual environments (of any kind) and comes with the most advanced coding tools.

Install PyCharm

First you should download the installer and follow the platform specific installation instructions.

Activate conda environment in PyCharm

After the PyCharm installation and the environment has been created a new folder exists in your anaconda installation. To use this environment within PyCharm you have to carry out the following steps, which are described in more detail and for all kinds of platforms and environments in the official PyCharm docs:

  1. Open the Preferences pane in PyCharm
  2. In the navigation list on the list, go to "Project: <your_folder_name>"
  3. In Project Interpreter click on "Show all" in the drop-down menu
  4. Click the + on the bottom
  5. Choose the Met4FoF environment and submit

Note that PyCharm updates the interpreter index. This can take some time. Afterwards you should be able to run the examples from the submodules and use all the project's code.

Update your copy

Whenever you want to get the latest changes, navigate into your local repository folder (i.e. ~/your/local/folder/Met4FoF_Code) and execute the command

$ git pull

to get the latest version of all the official project related code.

If you have not locally changed any of the files in the folders you will simply update all your local copies and get the latest version of all files on github.com/Met4FoF/Code.

MIGRATE FROM PREVIOUS VERSIONS

If you have a clone of this repository from prior to 17.09.2020 you have to once migrate your copy. At that time we switched from using Git submodules to so-called Git subtree mechanism. To migrate simply run the following command sequence once in the repository's root directory:

$ git submodule deinit --all --force
$ git pull

This temporarily deletes your copies of the former submodules and replaces them by the current versions in this repository. From then on simply use the command as stated in Update your copy to stay up-to-date.

Useful links

Check out our Git glossary to get insights into the Git vocabulary.