---
# System prepended metadata

title: LaPyn

---

# LaPyn


## Project details: 

**Applicant:** Bram van den Eijnden
**Faculty:** Civil Engineering and Geosciences
**DCC members:** Yasel Quintero (RSE)
**Support period:** December 2023 - May 2024
**Repository/Archive:** [GitLab repository](https://gitlab.com/lapyn/lapyn)

## Research Background 

Lapyn (Python Access to Lagamine) is a graphical user interface (GUI) for the LAGAMINE finite element solver. It serves as an alternative to the existing GUI for Lagamine, which was built using Visual Basic. The older Visual Basic-based interface is considered outdated and challenging to maintain or extend due to the limited familiarity with the language among the current Lagamine community.

## Project Description 

The project aimed to address several challenges associated with LaPyn:

**Supporting multiple materials**
Lagamine can simulate hundreds of materials, each defined by a unique set of parameters. Creating hand-crafted GUI dialogs for users to input parameters for every material type would be impractical. Therefore, a strategy was required to manage and accommodate all material types within LaPyn.

**Simplifying the installation process**
As a Windows desktop application, LaPyn needed a traditional graphical Windows installer to simplify deployment. This approach would ensure that end-users could avoid manually building the Python application or installing its dependencies.

Additionally, a project review was requested, with particular emphasis on evaluating the use of PyQT for processing user event signals.


## Project goals

The DCC aimed to provide hands-on support in implementing solutions for the challenges described above. The support activities included:

- Designing a strategy that allows Lapyn to handle all or most of the materials supported by Lagamine.
- Advising on how to develop a traditional Windows installer for the application.
- Conducting a review of the project's source code, offering recommendations for improvement and promoting the implementation of best programming practices.
- Guiding the researchers in collaborative software development using the Git Flow workflow, along with GitLab's issue tracking, pull requests, and continuous integration (CI) tools.

## Project Results

By the end of the support period, the project achieved the following outcomes:

**Collaborative Software Development**
Researchers were guided through a tutorial-like session that included practical exercises to teach collaborative software development techniques. The tutorial focused on the Git Flow workflow and the use of GitLab tools like issue tracking, pull requests, and continuous integration.

**Material Handling Strategy**
A strategy was developed to enable LaPyn to support all material types using the following approach:
- Recognizing that the parameters defining each material consist of common elements: integers, floating-point numbers, strings, and booleans.
- Creating a dynamic dialog system that allows users to build a list of input parameters for their materials. Users can select parameter types from a dropdown menu, assign them to the list, and define the material's name and numerical ID, aligning with the LAGAMINE manual.
- Implementing a material-specific dialog for assigning values to parameters, which allows users to save the material's details into a file formatted for LAGAMINE input.

This solution provided a scalable and user-friendly mechanism for managing all LAGAMINE-supported materials within LaPyn.

![lapyn_ui](https://hackmd.io/_uploads/Syj7Z1qfye.png)




## Lessons learned
- A Python API for QT exists.
- GitLab CI tools are notably more complex to use compared to GitHub Actions.
- There is less documentation available for GitLab features compared to GitHub, making it more challenging to navigate.
- GitLab is better suited for managing software projects led by large, industry-based teams rather than smaller, academic groups.