Working with the course material¶
Tools¶
We use the following main development tools in the course (you can learn them by doing)
python
for programming - An IDE may be helpful (jupyterlab may suffice, perhaps also VSCode, PyCharm, .. )- git - we may want to fork the main project and send commits/branches around - Using git (at least within jupyterlab) is needed
- jupyter - jupyterlab (e.g. through the gwdg jupyterhub cloud) suffices, but
- pytest - we want to test implementation and use
pytest
- gitlab - as project management system gitlab provides some further tools such as continuous integration (CI) which we will use
We will clone and setup the project together.
Setting up for the project¶
Forking the project¶
Go to the base project and fork it to your own namespace. This should copy many settings such as
- CI and
- gitlab pages deployment
- the docker container registry being active for your fork.
Once, you have forked the project, we can discuss the project together.
Note: Keep the fork updated with the base project. You will be noticed whenever there are important updates!
Cloning the project¶
To work on the project, you need to git
clone it to your local machine (or jupyter hub in the gwdg cloud).
Running the tests¶
You can see the tests in the tests
directory.
- They run with the CI pipeline (see in gitlab)
- You can run them locally by installing
pytest
and runningpytest
in thetests
directory. - Many of the existing tests still fail due to a missing implementation - this is left for you to fill up within the course.
- You should add more tests within the project
Demos¶
In demos
you should add larger examples, test cases, experiments, etc., as python or jupyter files. As of now there is only a single demo.
Some explanation on the code structure¶
Let us have a look at the code, directories and files together.
Generate simple class diagram (optional - don't care if it does not work)¶
We generate a class diagram. This requires pylint
and graphviz
to be installed on your system:
!pip install pylint graphviz --break-system-packages
!pyreverse --colorized -k -opdf ../src/methodsnm && mv classes.pdf ../graphics/classes.pdf
Now, we can inspect it in the notebook:
from IPython.display import IFrame
IFrame("../graphics/classes.pdf", width="100%", height=500)
#IFrame("../graphics/classes_ref.pdf", width="100%", height=500)
If displaying does not work (VSCode ?!), just directly navigate to it (or to a reference).