Working on the details and git

git Logo (Quelle und Lizenz)

After implementing irregular geometries using masked NumPy arrays, some maintenance work is needed. Variable names are inconsistent, and comments and docstrings for documenting the functions are missing.

The code currently contains three files:

  • main.py: the main file for basic configuration
  • manager.py: for file input and output, as well as controlling the iteration process
  • model.py: The model.

The code reads georeferenced TIF files, performs the iteration according to the criteria specified by the user using optimized math libraries, and outputs the results as georeferenced TIF files for the GIS. With a total of only 250 lines of code including comment lines, the project is very small and compactly programmed. It thus demonstrates the strength of Python and the modules used.

The performance is decent, but for larger projects, it’s significantly too slow. NumPy performs most calculations on a single processor core, so the next step is parallelization.

Since there are numerous possibilities for this and the solution used will require testing, managing the previously very compact codebase is also important. Therefore, the program code will be managed with the version control system git from now on and stored in a private repository on GitHub.