-
Notifications
You must be signed in to change notification settings - Fork 3
Home
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.
We start with the installation of the mandatory tools and then install and configure the recommended tools to work with the code.
The installation of Git for all platforms is very well described here.
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
- SourceTree
- Gitkraken
- PyCharm Community Edition Git integration.
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.
Once Git is installed, you are ready to create a local copy of the repository and take a first glance at the code.
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.
We then create a virtual environment with Miniconda (alternatively using pip
) to provide the currently needed packages of our project's code.
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.
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.
First you should download the installer and follow the platform specific installation instructions.
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:
- Open the Preferences pane in PyCharm
- In the navigation list on the list, go to "Project: <your_folder_name>"
- In Project Interpreter click on "Show all" in the drop-down menu
- Click the + on the bottom
- 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.
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.
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.
Check out our Git glossary to get insights into the Git vocabulary.