Note
This document provides contribution guidelines for students working on their theses. Please follow these steps carefully to ensure smooth collaboration.
- How to Contribute For Students
-
GitHub Username:
- Before starting your work, please create a GitHub account if you don’t have one already and send me your GitHub username. This will be necessary to set up your branch and reflect your contributions to the code.
-
Branch Creation:
- Ahmad will create a branch for your work once your thesis starts. This branch will be linked to an issue that allows you to track your progress. Our meetings are reserved for content discussion. The discussions in the issue are only related to code errors.
- You do not create branches yourself. Also, do not work on other student branches.
-
Creating Issues:
- Once your thesis starts, create an issue to describe the feature, bug fix, or enhancement you plan to implement. This helps us track contributions and avoids duplicate work. Keep the description abstract and add a few checkboxes listing what you want to add. You do not need to explicitly mention the methods. Keep it abstract, mentioning the purpose or benefits gained.
- Go to the Issues tab in the FTIO repository.
- Click New Issue and provide a clear title and description.
- Label the issue appropriately as
featureand include call itfeature.... - Once you push commits, some of them should address the issue.
- You should regularly update the issue (at least every few weeks).
-
Development Workflow:
-
Work only on the branch assigned to you.
-
Regularly pull updates from the
developmentbranch and merge them into your branch to stay up-to-date (at least every two weeks). -
Build FTIO with the debug flag so that changes made in the directory are directly visible to the command line call without reinstalling FTIO. For that call:
cd <ftio_repo> make debug #creates a virtual environment and install FTIO # or pip install -e .
-
follow the best practice guidelines to ensure code compatibility and a smooth experience for all developers
-
-
Merging Restrictions:
- You are not allowed to merge into the
developmentormainbranches.
- You are not allowed to merge into the
-
Adding Examples, Tests, and Documentation
- Any new feature or significant change should include:
- An example (or explanation in the doc on how to use the feature)
- A test case
- A documentation
- Examples should be minimal, reproducible, and placed in
examples/. Alternatively, the documentation shows how to use the new feature - Test cases must pass and follow existing structures.
- Documentation should be clear and concise.
- Any new feature or significant change should include:
-
Final Submission:
- Submit your work as documented here
- Periodically update your branch with changes from
development:git checkout development git pull origin development git checkout your-branch # Either merge or rebase with development git merge development # Or rebase for a linear history git rebase development
- Resolve any merge conflicts promptly and test your work.
- Make frequent commits with clear and descriptive messages. Ideally, once you are finished working on an aspect, you create a commit for it. Before committing, always check and fix the style:
cd <ftio_repo>
make check_styleAfterward, stage the files you want to push
git add file1.py ./some_location/file2.pygit commit -m "FTIO: Add feature X to improve performance"Afterwards, push your changes from your local branch to your remote:
# You are on your-branch (check using git branch -a)
git pushNote
Avoid using overly short or overly descriptive commit messages, such as 'update' or 'code cleaned'.
Note
Always check that your commits align with the style used. For that, call 'make check_style' in the root directory of the repo. An easier, more automated way is explained here.
- You are not allowed to merge into the
developmentormainbranches.
You can make things even easier regarding the style by combining this with a Git hook. For that
Create a file called pre-commit under the root directory's .git folder (.git/hooks/pre-commit).
cd <ftio_repo>
touch .git/hooks/pre-commit
chmod +x .git/hooks/pre-commitNow add the following content to it:
#!/bin/bash
echo "Running black formatter..."
black .
echo "Running ruff..."
ruff check --fixThat's it. Now every time you commit, the code is formatted correctly.
- Link commits to your assigned issue.
- Update issues regularly.
- Use issue discussion only for code-related questions.
- Add an example, test case, and documentation for each significant change.
- Follow section instructions for:
- Ensure all tests pass, style checks succeed, examples and documentation are complete.
- Clean up unused code or debug output.
- Make sure all above points are addressed (especially 4 and 5)
- Tag your final version:
git tag -a BA_time_window_adaptation -m "Bachelor Thesis: implementation and evaluation of time window adaptation" git push --tags - Check that all previous points are covered (especially Point 6).
- When your thesis is complete, create a pull request (PR) to merge your branch into the
developmentbranch. - Include a summary of your work and link the pull request to your issue for reference.
- Don’t forget to add yourself to the list of contributors.
-
Appropriate Language:
- Use professional, respectful, and clear language in all commit messages, comments, and documentation.
- Avoid using slang, jokes, or informal phrases that could be misinterpreted or deemed inappropriate.
-
Avoid Bad Language:
- Refrain from using any offensive, vulgar, or discriminatory language in any form. This applies to commit messages, comments, documentation, or communication within the team.
-
Be Respectful:
- Show courtesy when discussing issues, asking questions, or providing feedback. Collaborative communication is key to the success of the project.
-
Constructive Feedback:
- Provide helpful suggestions or feedback without criticism that could discourage others.
-
Gender-Neutral and Inclusive Language:
- Ensure that all language used in the project, including commit messages, documentation, and communication, is gender-neutral and inclusive. Avoid using gendered pronouns or assumptions, and instead use terms that are respectful and inclusive of all genders. This helps create a welcoming environment for everyone involved in the project.
- External dependencies: Some features in the project rely on optional external dependencies (e.g.,
fastdtw,dash,dash-extensions), which are not essential, but provide an optimized version or additional functionalities. If these dependencies are not available, the code should fall back and continue to function without those specific features as described [here] - Stay Updated: Regularly pull changes from
developmentto avoid large merge conflicts. Also, keep the issue updated. - Communicate: Reach out if you encounter issues or need clarification.
- Test Thoroughly: Ensure your work doesn’t break existing functionality. Do not rename or reformat entire documents, except if you created them from scratch. Regularly test your code with your test case.
- Document Changes: Write clear comments and update related documentation as needed.
Some features in the project rely on optional external dependencies (e.g., fastdtw). If these dependencies are not
available, and if they are not essential, the code should fall back and continue to function without those specific
features.
Example of how to handle optional dependencies:
import numpy as np
import importlib.util
from scipy.spatial.distance import euclidean
# Check if fastdtw is available
FASTDTW_AVAILABLE = importlib.util.find_spec("fastdtw") is not None
if FASTDTW_AVAILABLE:
from fastdtw import fastdtw
## Call DTW function
def fdtw(s1, s2):
if FASTDTW_AVAILABLE:
return fastdtw(s1, s2, dist=euclidean)
else:
return fill_dtw_cost_matrix(s1, s2)
## Fill DTW Cost Matrix using NumPy
def fill_dtw_cost_matrix(s1, s2):
...Note
External dependencies should be avoided as much as possible, as each additional dependency introduces a potential risk for the code to break. Only include dependencies that are essential for the core functionality of the project. Optional dependencies should be handled in a way that the code can continue functioning without them, using fallbacks where possible.
To keep the codebase maintainable and collaboration-friendly, we recommend organizing your work into **cohesive modules ** rather than placing everything into a single file or a monolithic script.
- Avoid merge conflicts: Isolating related functionality into separate files reduces the chances of developers working on the same file at the same time.
- Improve readability: Smaller, focused modules are easier to read, understand, and review.
- Enhance reusability: Modular code is easier to reuse across different parts of the project.
- Enable testing: Individual modules and their functions can be unit tested more effectively.
While modularization is good, creating too many small or overly granular files can:
- Make the project harder to navigate.
- Introduce unnecessary complexity in the import structure.
- Obscure the overall logic of the system.
Guideline: Group logically related functions or classes into a single module. Avoid creating new files for each utility or tiny helper unless it serves a clear organizational purpose.
Every new module should start with a module-level docstring to explain its purpose, authorship, and license. Below is a template you should use:
"""
Example Description:
This module provides helper functions for setting up and managing the JIT environment.
It includes utilities for checking ports, parsing options, allocating resources,
handling signals, and managing components like FTIO, GekkoFS, and Cargo.
Author: Your Name
Copyright (c) 2025 TU Darmstadt, Germany
Date: <Month Year>
Licensed under the BSD 3-Clause License.
For more information, see the LICENSE file in the project root:
https://github.com/tuda-parallel/FTIO/blob/main/LICENSE
"""To demonstrate how to use FTIO with you new feature, you should add a relevant example under the examples directory:
-
Create a new example script in the
examplesfolder. -
Ensure the example is clear, easy to understand, and includes proper usage of
FTIO. -
Push and commit your changes:
git add examples/your_example.py git commit -m "FTIO: Add example usage of feature XXX"
To add a test case for verifying your changes, follow these steps:
-
Write a new test script in the
testdirectory to check for the desired functionality ofFTIO. -
Ensure the test is clear and isolates the tested functionality.
-
Push and commit your changes:
git add test/test_example.py git commit -m "Add test case for FTIO read/write functionality" -
Regularly test your testcase:
cd <ftio_repo> make test
-
Regularly check that you code is conform with the style:
make check_style
To ensure proper documentation for your work, follow these steps:
-
Write a new documentation file or update an existing one in the
docsdirectory. -
Include relevant details, such as how to use the example, the purpose of the test cases, and any other important information.
-
Push and commit your changes:
git add docs/example_usage.md git commit -m "FTIO: Add documentation for feature XXX" -
If you made changes to the command line arguments, please update the usage section in the readme.
We sincerely thank the following contributors for their valuable contributions:
- Ahmad Tarraf
- Jean-Baptiste Bensard: Metric proxy integration
- Anton Holderied: bachelor thesis –> new periodicity score
- Tim Dieringer: bachelor thesis -> Additional integration for Metric Proxy
- Amine Aherbil: bachelor thesis -> adaptive change point detection
- Julian Opper, Luca Schultze: PPT Lab -> Improved CI/CD pipeline