diff --git a/develop/404.html b/develop/404.html index 15d6113..c7cef2e 100644 --- a/develop/404.html +++ b/develop/404.html @@ -146,6 +146,43 @@ + + +
diff --git a/develop/development/best-practice/code_style/index.html b/develop/development/best-practice/code_style/index.html index 16a7571..8aa29c9 100644 --- a/develop/development/best-practice/code_style/index.html +++ b/develop/development/best-practice/code_style/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/best-practice/continuous_integration/index.html b/develop/development/best-practice/continuous_integration/index.html index 4fdb8e0..2147bf3 100644 --- a/develop/development/best-practice/continuous_integration/index.html +++ b/develop/development/best-practice/continuous_integration/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/best-practice/index.html b/develop/development/best-practice/index.html index c5b2aed..b2f0ff6 100644 --- a/develop/development/best-practice/index.html +++ b/develop/development/best-practice/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/best-practice/pre_commit_hooks/index.html b/develop/development/best-practice/pre_commit_hooks/index.html index ae0f848..081c6fc 100644 --- a/develop/development/best-practice/pre_commit_hooks/index.html +++ b/develop/development/best-practice/pre_commit_hooks/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/best-practice/test_driven_development/index.html b/develop/development/best-practice/test_driven_development/index.html index d185ee8..5cc24a3 100644 --- a/develop/development/best-practice/test_driven_development/index.html +++ b/develop/development/best-practice/test_driven_development/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/chat/index.html b/develop/development/collaboration/chat/index.html index e4a78e6..1674fc6 100644 --- a/develop/development/collaboration/chat/index.html +++ b/develop/development/collaboration/chat/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/code_of_conduct/index.html b/develop/development/collaboration/code_of_conduct/index.html index d4f34d4..20b6d2a 100644 --- a/develop/development/collaboration/code_of_conduct/index.html +++ b/develop/development/collaboration/code_of_conduct/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/git/index.html b/develop/development/collaboration/git/index.html index 3bcb93b..15656c9 100644 --- a/develop/development/collaboration/git/index.html +++ b/develop/development/collaboration/git/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/index.html b/develop/development/collaboration/index.html index 4b9d35b..442159f 100644 --- a/develop/development/collaboration/index.html +++ b/develop/development/collaboration/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/license_and_citation/index.html b/develop/development/collaboration/license_and_citation/index.html index 8b2c89e..de9a21e 100644 --- a/develop/development/collaboration/license_and_citation/index.html +++ b/develop/development/collaboration/license_and_citation/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/meeting/index.html b/develop/development/collaboration/meeting/index.html index f027357..4b8e094 100644 --- a/develop/development/collaboration/meeting/index.html +++ b/develop/development/collaboration/meeting/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/collaboration/users/index.html b/develop/development/collaboration/users/index.html index f23b028..bbdb357 100644 --- a/develop/development/collaboration/users/index.html +++ b/develop/development/collaboration/users/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/documentation/index.html b/develop/development/documentation/index.html index 0382c88..34bb246 100644 --- a/develop/development/documentation/index.html +++ b/develop/development/documentation/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/development/release/index.html b/develop/development/release/index.html index cadc5e3..87a630b 100644 --- a/develop/development/release/index.html +++ b/develop/development/release/index.html @@ -157,6 +157,43 @@ + + +
diff --git a/develop/index.html b/develop/index.html index dee349f..f0788b5 100644 --- a/develop/index.html +++ b/develop/index.html @@ -155,6 +155,43 @@ + + +
diff --git a/develop/search/search_index.json b/develop/search/search_index.json new file mode 100644 index 0000000..d4dfbf2 --- /dev/null +++ b/develop/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-,:!=\\[\\]()\"/]+|(?!\\b)(?=[A-Z][a-z])|\\.(?!\\d)|&[lg]t;","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to the Super-Repository Documentation","text":"

A template repository to test and document elements and features for research software. It implements the collection of repository elements and files. The goal is to simplify and standardise the creation of software in GitHub repositories.

"},{"location":"#documentation-structure","title":"Documentation Structure","text":"

The documentation is separated into two main sections: Development and Code Documentation.

"},{"location":"#fields-for-development","title":"Fields for development","text":"

Files and structures related to collaborative development, community processes, and documentation.

  • Collaboration
  • Best-Practices
  • Documentation
  • Release
"},{"location":"#fields-for-code-documentation","title":"Fields for code documentation","text":"

Methods and functions of the module.

  • Install
  • Functions
  • Code Example
"},{"location":"development/best-practice/","title":"Best Practices","text":"

Adopting best practices in software development enhances code quality, maintains consistency, and ensures reliability. This section focuses on three key methodologies essential for maintaining high standards in a collaborative scientific software environment:

  • Continuous Integration (CI): Automating the integration of code changes to catch errors early and maintain a stable codebase. CI ensures that all contributions are rigorously tested and integrated seamlessly into the project.

  • Test-Driven Development (TDD): A methodology where tests are written before the actual code implementation. TDD promotes robust and well-designed code by enforcing that each feature is accompanied by thorough testing from the outset.

  • Pre-commit Hooks (PCH): Tools to enforce code quality and consistency by running checks or scripts before changes are committed. These hooks help identify issues early, improving code hygiene and reducing technical debt.

Following these practices will streamline development, reduce bugs, and foster a productive, collaborative coding environment.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/best-practice/code_style/","title":"Code Style","text":"

This document aims to provide clear instructions on how to write clean, readable, and maintainable Python code. Adhering to these guidelines will ensure consistency across the codebase and foster collaboration among contributors. Maintaining a consistent code style is crucial for the readability and maintainability of a Python project.

We enforce most of the following guidelines in our Continuous-Integration pipeline that check the code automatically.

"},{"location":"development/best-practice/code_style/#1-installation","title":"1. Installation","text":"

Before contributing to the project, make sure you have the necessary tools installed for code style enforcement. We utilize pre-commit to automate code checks before committing changes.

"},{"location":"development/best-practice/code_style/#2-code-formatting","title":"2. Code Formatting","text":"

Consistent code formatting enhances readability and reduces unnecessary debates about style. We use Ruff as Python code formatter. It automatically formats your code to adhere to the project's style guidelines.

"},{"location":"development/best-practice/code_style/#3-naming-conventions","title":"3. Naming Conventions","text":"

While we don't enforce strict naming conventions, we encourage compliance with PEP8 and the Google Python Style Guide for consistency. Descriptive names and adherence to conventions improve code clarity.

"},{"location":"development/best-practice/code_style/#4-indentation-and-whitespace","title":"4. Indentation and Whitespace","text":"

We follow the Python standard of using 4 spaces for tab indentation. Do not include any trailing whitespace at the end of lines.

"},{"location":"development/best-practice/code_style/#5-comments-and-documentation","title":"5. Comments and Documentation","text":"

Effective comments and docstrings are vital for code understanding. Use comments to explain complex logic and docstrings to describe functions, classes, and modules. Following good documentation practices ensures code is understandable to others.

"},{"location":"development/best-practice/code_style/#6-code-structure-and-organization","title":"6. Code Structure and Organization","text":"

Maintain a logical structure within files, grouping related functions and classes. Consider the readability of your code and strive for modular, well-organized files.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/best-practice/continuous_integration/","title":"Continuous Integration (CI) and Test Automation","text":"

Continuous Integration (CI) ensures consistent code quality through automated testing, reporting, and deployments. Our setup combines GitHub Actions and tox to streamline testing across environments, making the process robust and efficient.

"},{"location":"development/best-practice/continuous_integration/#github-actions-workflows","title":"GitHub Actions: Workflows","text":"

GitHub Actions automates key workflows like testing, linting, and code quality checks. The CI pipeline includes the following tasks: - Unit Testing: Using pytest to ensure comprehensive test coverage. - Code Formatting: Validating syntax with ruff. - Linting: Verifying code style and docstrings with ruff.lint. - Import Sorting: Organizing imports with ruff.lint.isort.

To set up GitHub Actions workflows for the repository, follow the official GitHub guide. The GitHub Actions workflow is triggered on pull requests or commits to the develop or production branches. 1. Setup: Prepares a Python environment and installs dependencies. 2. Testing: Executes the tox automation suite to run the defined tests. 3. Reporting: Generates detailed failure reports for debugging.

GitHub Actions also automates documentation updates, ensuring the latest changes from the develop branch are reflected. For more details, see the official GitHub Actions guide.

"},{"location":"development/best-practice/continuous_integration/#tox-automating-testing","title":"Tox: Automating Testing","text":"

tox is a versatile tool for managing test environments and automating testing tasks across Python versions and operating systems (Linux, macOS, Windows). It enhances reproducibility and reliability by creating isolated environments for testing:

  • Virtual Environments: Isolates dependencies for each Python version.
  • Automated Testing: Runs tests and style checks (for example, pytest, ruff).
  • Cross-Version/Platform Testing: Ensures compatibility across Python versions and operating systems.
  • Dependency Management: Customizes dependencies for diverse test scenarios.
  • Reproducibility: Maintains consistent workflows by way of \ud83d\udcdd tox.ini.
  • Extensibility: Supports plugins for custom functionality.
"},{"location":"development/best-practice/continuous_integration/#install","title":"Install","text":"

Install the required package in a python environment. \ud83d\udcbb pip install tox Install tox \ud83d\udcbb tox Run tox locally

"},{"location":"development/best-practice/continuous_integration/#adding-and-managing-tests","title":"Adding and Managing Tests","text":"

New tests should be placed in the \ud83d\udcdd test/ directory. For example: - Add a test to validate new functionality. - Use pytest for unit tests, or extend \ud83d\udcdd tox.ini for additional test configurations.

By combining tox and GitHub Actions, our CI pipeline ensures robust, reproducible, and scalable testing workflows.

"},{"location":"development/best-practice/continuous_integration/#test-patterns","title":"Test Patterns","text":"
  1. Unit and Integration Test
  2. Purpose: Test individual functions or methods.
  3. Framework: unittest, pytest
  4. Example: Simple function test and external API interactions.

  5. Functional Testing

  6. Purpose: Test complete functionality (end-to-end).
  7. Framework: pytest, selenium
  8. Example: Test user login in a web app.

  9. Mocking

  10. Purpose: Simulate external dependencies.
  11. Framework: unittest.mock, pytest-mock
  12. Example: Mock API calls in tests.

  13. Acceptance Testing

  14. Purpose: Verify the software meets requirements.
  15. Framework: pytest, Behave
  16. Example: Verify login form functionality.

  17. Performance Testing

  18. Purpose: Measure performance under load.
  19. Framework: pytest-benchmark, locust
  20. Example: Measure function execution time.

  21. Security Testing

    • Purpose: Test for security vulnerabilities.
    • Framework: bandit
    • Example: Scan for hardcoded passwords.
  22. Snapshot Testing

    • Purpose: Compare outputs to saved snapshots.
    • Framework: pytest-snapshot
    • Example: Compare function output snapshots.
  23. Property-Based Testing

    • Purpose: Test properties of functions with random inputs.
    • Framework: hypothesis
    • Example: Test that a sorting function always returns a sorted list.
"},{"location":"development/best-practice/continuous_integration/#examples","title":"Examples","text":"

The file \ud83d\udcdd test/test_example.py contains basic examples for the functions in \ud83d\udcdd super_repo/test_calculator.py.

In Python, the assert statement is used to test if a condition is true. If the condition is false, an AssertionError is raised, indicating the test failed.

result = add(3, 4)\nassert result == 7\n

The raises context manager from the pytest library ensures that a ValueError is raised. The match argument specifies that the error message matches the expected error pattern.

with raises(ValueError, match=r\"Cannot divide by zero\"):\n    divide(15, 0)\n

We encourage contributions of additional tests and examples to help improve coverage and showcase different use cases\u2014your input is valuable to enhancing the project!

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/best-practice/pre_commit_hooks/","title":"Pre-commit Hooks","text":"

Pre-commit hooks are tools used to enforce code quality and consistency by running checks or scripts before changes are committed. These hooks help identify issues early, improving code hygiene.

"},{"location":"development/best-practice/pre_commit_hooks/#installation-and-setup","title":"Installation and Setup","text":"

Install the package in your base environment. \ud83d\udcbb pip install pre-commit

Create a \ud83d\udcdd .pre-commit-config.yaml file in your repository root. This file defines the hooks and configurations.

"},{"location":"development/best-practice/pre_commit_hooks/#usage","title":"Usage","text":"

To run the hooks manually, use: \ud83d\udcbb pre-commit run --all-files

Now, every time you commit changes, the pre-commit hooks will automatically run the checks defined in your configuration file, ensuring code quality before committing.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/best-practice/test_driven_development/","title":"Test-Driven Development","text":"

Test-Driven Development (TDD) is a software development methodology that emphasizes writing tests before implementing the corresponding functionality. This approach ensures that new changes do not unintentionally break existing features and that all functions perform as expected.

"},{"location":"development/best-practice/test_driven_development/#code-coverage","title":"Code Coverage","text":"

Code coverage is a metric used in software testing that helps determine the percentage of code that is exercised by tests. It is an essential tool for assessing the effectiveness of your test suite. High code coverage generally indicates that most of your code has been tested, while lower coverage can suggest that some parts of the application may be under-tested, potentially leading to hidden bugs or vulnerabilities.

Codecov.io is a popular tool for tracking and visualizing code coverage. It integrates with various CI/CD pipelines and allows developers to upload their coverage reports. Once integrated, Codecov provides detailed insights into code coverage trends, coverage gaps, and areas that require further testing.

To integrate Codecov with your project, follow these steps:

  1. Install pytest \ud83d\udcbb pip install pytest pytest-cov

  2. Add GitHub Action \ud83d\udcdd .github/workflows/codecov.yml

  3. Create an account Create a Codecov account at Codecov.io and link your repository.

  4. Upload the Coverage Report After running your tests with coverage, upload the results to Codecov. This is done automatically through the CI configuration.

  5. View Coverage Reports Once your coverage report is uploaded, you can view detailed insights and trends on the Codecov dashboard.

  6. Code Coverage Badge A coverage badge provides a visual indication of the test coverage for the \ud83d\udcdd README.rst page. It is updated automatically as new reports are uploaded to Codecov.

While code coverage is a valuable metric for identifying untested code, high coverage does not necessarily indicate high-quality tests. It only measures the quantity of code exercised during testing, not the quality or effectiveness of those tests. Tests can pass without actually verifying correct behavior, and some areas of the code may be covered by trivial tests that do not expose potential issues. Relying solely on coverage can lead to a false sense of security and might divert attention from other important aspects of testing, such as edge cases and integration scenarios.

"},{"location":"development/best-practice/test_driven_development/#example-implementing-test-cases-for-a-django-app","title":"Example: Implementing Test Cases for a Django App","text":"

This example demonstrates the TDD approach within a Django app. You can run all tests in Django using the following command:

\ud83d\udcbb `python manage.py test`\n

To run specific test cases, you can provide the app name and the test case:

\ud83d\udcbb `python manage.py test app.MyModelViewTestCase`\n

This is a Step-by-Step Guide to TDD in Django:

"},{"location":"development/best-practice/test_driven_development/#1-set-up-the-django-app","title":"1. Set Up the Django App","text":"

Ensure that you have a Django app in place that you wish to test.

"},{"location":"development/best-practice/test_driven_development/#2-write-a-test-for-the-new-feature","title":"2. Write a Test for the New Feature","text":"

Begin by writing a test for the functionality you intend to implement. For example, if you need to create a view that returns a list of objects from the database, and a corresponding model to represent the database table, your test might look like this: \ud83d\udcdd app/test/my_test.py:

from django.test import TestCase\nfrom myapp.models import MyModel\n\nclass MyModelViewTestCase(TestCase):\n    def test_list_view_displays_all_objects(self):\n        MyModel.objects.create(name=\"object1\")\n        MyModel.objects.create(name=\"object2\")\n        response = self.client.get('/my-models/')\n        self.assertEqual(response.status_code, 200)\n        self.assertContains(response, \"object1\")\n        self.assertContains(response, \"object2\")\n
"},{"location":"development/best-practice/test_driven_development/#3-run-the-test","title":"3. Run the Test","text":"

At this point, run the test to confirm it fails, as the view has not been implemented yet. \ud83d\udcbb python manage.py test

"},{"location":"development/best-practice/test_driven_development/#4-implement-the-model-and-view","title":"4. Implement the Model and View","text":"

Implement the model and view to make the test pass.

\ud83d\udcdd models.py:

from django.db import models\n\nclass MyModel(models.Model):\n    name = models.CharField(max_length=255)\n    created_at = models.DateTimeField(auto_now_add=True)\n\n    def __str__(self):\n        return self.name\n

\ud83d\udcdd views.py:

from django.views.generic import ListView\nfrom myapp.models import MyModel\n\nclass MyModelListView(ListView):\n    model = MyModel\n    template_name = \"myapp/my_model_list.html\"\n
"},{"location":"development/best-practice/test_driven_development/#5-run-the-test-again","title":"5. Run the Test Again","text":"

Run the tests again to ensure the changes pass the test. \ud83d\udcbb python manage.py test

"},{"location":"development/best-practice/test_driven_development/#6-add-additional-tests","title":"6. Add Additional Tests","text":"

Write additional tests to verify that the view works as expected. For example, you can test for empty responses:

class MyModelViewTestCase(TestCase):\n    def test_list_view_displays_all_objects(self):\n        MyModel.objects.create(name=\"object1\")\n        MyModel.objects.create(name=\"object2\")\n        response = self.client.get('/my-models/')\n        self.assertEqual(response.status_code, 200)\n        self.assertContains(response, \"object1\")\n        self.assertContains(response, \"object2\")\n\n    def test_list_view_displays_empty_message(self):\n        response = self.client.get('/my-models/')\n        self.assertEqual(response.status_code, 200)\n        self.assertContains(response, \"No objects found.\")\n
"},{"location":"development/best-practice/test_driven_development/#7-run-all-tests","title":"7. Run All Tests","text":"

Finally, run all the tests to ensure they pass successfully: \ud83d\udcbb python manage.py test

"},{"location":"development/best-practice/test_driven_development/#conclusion","title":"Conclusion","text":"

TDD provides a structured approach to writing reliable, maintainable software. By ensuring that tests are written before implementing functionality, developers can be confident that new changes will not introduce unintended side effects and that the codebase remains functional and robust over time.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/","title":"Collaboration","text":"

This open-source software is a collaborative effort. The repository has several elements to provide necessary functions.

To participate in the development you can do the following:

  • Contribute to the GitHub Discussions
  • Contribute to the GitHub Issues
  • Follow the workflow for collaborative development
  • Get in touch with the community on the Element Chat
  • Meet the developers in one of the regular meetings

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/chat/","title":"Chat","text":"

For direct communication, this repository uses a public Element room. This messenger platform is based on the [matrix] communication protocol and can be accessed without a mobile phone.

To engage with the developer and user community, login with an existing account (for example GitHub) or register a new account.

The room name is: Super-Repository:matrix.org.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/code_of_conduct/","title":"Code of Conduct","text":"

This repository is following the Contributor Covenant Code of Conduct.

Everyone is asked to be self-reflective and always maintain a good culture of discussion and active participation. This includes written communication in this repository and direct encounters in meetings and events.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/git/","title":"Git","text":""},{"location":"development/collaboration/git/#branches","title":"Branches","text":"

Git Branches are used to structure the developments and improvements.

"},{"location":"development/collaboration/git/#permanent-branches","title":"Permanent Branches","text":"
  • production - includes the current stable (latest) version
  • develop - includes all current developments
"},{"location":"development/collaboration/git/#temporary-branches","title":"Temporary Branches","text":"
  • feature - includes the feature and improvements that will be implemented
  • hotfix - includes small improvements before a release, should be branched from a release branch
  • release - includes the current version to be released

The majority of the development will be done in feature branches.

"},{"location":"development/collaboration/git/#gitignore","title":"Gitignore","text":"

This file specifies intentionally untracked files to ignore. It is copied from a collection of .gitignore templates. For more information about how \ud83d\udcdd .gitignore files work, see the Ignoring Files chapter of the Pro Git book.

"},{"location":"development/collaboration/git/#issue-templates","title":"Issue Templates","text":"

Issue Templates offer specific functions and default configurations for new issues.

  • Feature Issue
  • Bug Issue
  • Release Issue
  • User Kudos Issue
"},{"location":"development/collaboration/git/#pull-request-pr-template","title":"Pull Request (PR) Template","text":"

The Pull Request Template is used for all PR, because it is only possible to create a single one. It includes all needed information to merge branches and release new versions.

"},{"location":"development/collaboration/git/#github-labels","title":"GitHub Labels","text":"

GitHub Labels are used to organize Issues and PR. Colours and emoticons improve presentation, see: \ud83d\udcdd github-labels.json

"},{"location":"development/collaboration/git/#github-workflows-actions","title":"GitHub Workflows (Actions)","text":"

GitHub Actions are used to automate processes of the repository. Main use-cases are building and publishing the documentation and run automated tests.

"},{"location":"development/collaboration/git/#pre-commit","title":"Pre-commit","text":"

Pre-commit is a tool to easily setup and run pre-commit hooks for your git repository. See the best-practice documentation of pre-commit or the official documentation for further information. It is used to improve auto-format code, do linting and run tests before every commit.

"},{"location":"development/collaboration/git/#install","title":"Install","text":"

Install the required package in a python environment. \ud83d\udcbb pip install pre-commit Install pre-commit \ud83d\udcbb pre-commit install Install pre-commit

"},{"location":"development/collaboration/git/#setup","title":"Setup","text":"

The hooks are configured in the file \ud83d\udcdd .pre-commit-config.yaml. List of implemented hooks:

  • Pre-commit-hooks - Out-of-the-box hooks
  • Black - Python code formatter
  • isort - Sort Python imports
  • Ruff - Fast Python linter, written in Rust
  • Flake8 - Python linter with PyFlakes and pycodestyle
  • mypy mirror - Added static types to Python
  • mirrors-prettier - Formatting for other files then python scripts
  • reuse - License and copyright information
"},{"location":"development/collaboration/git/#use","title":"Use","text":"

All commits will trigger the hooks automatically. \ud83d\udca0 git commit file -m \"Commit message #IssueNr\" Commit with message

Commit without running the hooks. \ud83d\udca0 git commit --no-verify file Commit without hooks

Line endings

There can be problems with file line endings on Windows, CRLF is used on Windows and LF is used on Linux.

To run the hooks on all files in your repository use: \ud83d\udcbb pre-commit run --all-files Run pre-commit hooks

Markdown files / Admonitions

If the hook is applied to markdown files that include special formatting, (for example \ud83d\udcdd mkdocs.yml), this can introduce incorrect changes. This effects admonitions boxes for MkDocs.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/license_and_citation/","title":"License","text":""},{"location":"development/collaboration/license_and_citation/#software-license","title":"Software License","text":"

This software is developed under an open-source license. The selected license can be read in the LICENSE.txt.

The users have permission to run and use, modify, distribute the program, and release the improvements as long as you follow the license obligations to give a proper attribution and include the license text.

Please attribute as:

\"Super-Repository\" \u00a9 Reiner Lemoine Institut | MIT License

"},{"location":"development/collaboration/license_and_citation/#reuse","title":"REUSE","text":"

This repository follows the REUSE SOFTWARE specification. All files are explicitly stating the corresponding license and copyright information. It is implemented as GitHub workflow and pre-commit hook:

  • GitHub workflow: reuse.yml
  • Pre-commit hook

All copyright information should follow this example:

SPDX-FileCopyrightText: {$year_of_file_creation} {$name_of_author} <{contact}> \u00a9 {$name_of_copyright_holder}\nSPDX-FileCopyrightText: {$year_of_file_creation} {$name_of_author2} <{contact2}> \u00a9 {$name_of_copyright_holder2}\n\nSPDX-License-Identifier: {$SPDX_license_name}\n
"},{"location":"development/collaboration/license_and_citation/#citation","title":"Citation","text":"

To scientifically cite this repository, see the Cite this repository function or the file CITATION.cff.

"},{"location":"development/collaboration/license_and_citation/#contributing","title":"Contributing","text":"

Since this software is under an open source license and can be downloaded, run and modified, you are invited to comment, improve and develop the program as you wish. To contribute to the collaborative development follow the workflow described in CONTRIBUTING.md.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/meeting/","title":"Meetings","text":"

In order to develop a program collaboratively, it is helpful to regularly exchange information about the current status and to discuss open questions and make decisions. If you want to join the meetings, please use the GitHub Discussions.

"},{"location":"development/collaboration/meeting/#developer-meetings","title":"Developer Meetings","text":"

In the regular developer meetings, the open issues and pull requests are discussed and the next release is planned. There should also be time for the general vision of software development.

The regular developer meeting takes place on the first Wednesday of the month between 9 and 9:30 am. The meeting room is: meet.jit.si/super-repo-dev

"},{"location":"development/collaboration/meeting/#user-meetings","title":"User Meetings","text":"

The user meeting is specifically designed for users of the software to ask questions about usage, make requests for new functionality, or give general feedback.

The regular user meeting takes place after the developer meeting in the same room on the first Wednesday of the month between 9:30 and 10 am.

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/collaboration/users/","title":"Users","text":"

Known user of this software can be added to \ud83d\udcdd USERS.cff for reference. Please use the issue template: \ud83d\udcdd issue_template_user_kudos.md

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/documentation/","title":"Documentation","text":""},{"location":"development/documentation/#readme","title":"README","text":"

The repository contains a \ud83d\udcdd README.rst file with basic information. It gives a short introduction to the project and links to other relevant files.

"},{"location":"development/documentation/#changelog","title":"Changelog","text":"

The \ud83d\udcdd CHANGELOG.md is a record of all notable changes made to a project. It is structured by each release and divided by additions, changes, and removals.

"},{"location":"development/documentation/#mkdocs","title":"MkDocs","text":"

MkDocs is a fast and simple static site generator that is used for documentation. The source files are written in Markdown, and configured with \ud83d\udcdd mkdocs.yml. Material theme enables additional features and an elegant design.

"},{"location":"development/documentation/#install","title":"Install","text":"

Install the required packages in a python environment. \ud83d\udcbb pip install mkdocs Install MkDocs \ud83d\udcbb pip install mkdocs-material Install the material theme

"},{"location":"development/documentation/#build","title":"Build","text":"

Generate the documentation locally. \ud83d\udcbb mkdocs serve Start the local live version of the documentation \ud83d\udcbb mkdocs build Create a folder site with the documentation

"},{"location":"development/documentation/#publish","title":"Publish","text":""},{"location":"development/documentation/#manually","title":"Manually","text":"

Publish documentation on GitHub Pages. \ud83d\udcbb mkdocs gh-deploy Manually deploys the documentation files

Manually deploy documentation

This command overrides all manually deployed versions (mike).

"},{"location":"development/documentation/#github-action","title":"GitHub Action","text":"

\ud83d\udc19 Deploy the documentation with GitHub Actions. The file \ud83d\udcdd .github\\workflows\\documentation.yml creates an automated GitHub workflow. It is configured to be pushed to the branch gh-page and then deployed online. A commit on the develop branch starts the workflow.

"},{"location":"development/documentation/#mike","title":"Mike","text":"

The package mike is used to deploy multiple versions of the documentation. \ud83d\udcbb pip install mike Install mike \ud83d\udcbb mike deploy --push --update-aliases 0.1 latest Deploys the latest version \ud83d\udcbb mike set-default --push latest Set the default version to latest \ud83d\udcbb mike deploy develop --push Deploys the develop branch

Mike Versions

It is recommended to use only the Minor Versions (for example 0.1) and exclude the Patch Version (for example 0.1.1)!

Other useful commands are: \ud83d\udcbb mike serve Test mike on http://localhost:8000 \ud83d\udcbb mike list List all versions \ud83d\udcbb mike retitle 1.0.0 1.0.1 --push Rename a version \ud83d\udcbb mike delete 0.1 --push Deletes a specific versions \ud83d\udcbb mike delete --all --push Deletes all versions

When adding older versions, load the Git Tags used for the releases: \ud83d\udca0 git checkout v0.1.1 \ud83d\udcbb mike deploy 0.1 --push Deploys the old version 0.1

When building mike locally, the branch gh-pages is modified locally. \ud83d\udcbb error: gh-pages is unrelated to origin/gh-pages \ud83d\udca0 git branch -D gh-pages Delete the local documentation branch

"},{"location":"development/documentation/#mkdocstrings","title":"mkdocstrings","text":"

mkdocstrings generates automatic documentation (autodocs) from Google style docstrings. \ud83d\udcbb pip install mkdocstrings Install mkdocstrings

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"development/release/","title":"Release","text":"

The software release has four main goals:

  1. Merge the new features to the production branch
  2. Create a GitHub Release
  3. Update the documentation
  4. Publish a new version of the package at PyPI

The \ud83d\udcdd RELEASE_PROCEDURE.md contain detailed instructions to do a release.

"},{"location":"development/release/#automated-versioning-with-bumpversion","title":"Automated Versioning with Bumpversion","text":"

Bumpversion is a tool for automated version management in software projects. It ensures consistent version updates across files and documentation by specifying a part to increment (major, minor, or patch). This streamlines release workflows and keeps project versioning synchronized.

Install package: \ud83d\udcbb pip install --upgrade bump-my-version \ud83d\udcdd .bumpversion.toml Configuration file for versioning rules and affected files

Test bumpversion: \ud83d\udcbb bump-my-version show-bump Preview next possible versions \ud83d\udcbb bump-my-version bump minor --dry-run -vv Sandbox bump

Use bumpversion: \ud83d\udcbb bump-my-version bump --current-version 0.2.0 minor Run bumpversion \ud83d\udca0 git push Push bumpversion changes

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"},{"location":"user_documentation/","title":"Functions","text":"

mkdocstrings

This software uses mkdocstings to render docstrings from files.

The code documentation is implemented by writing docstrings. See the mkdocstrings documentation.

"},{"location":"user_documentation/code_example/","title":"Code Example","text":"

About the example

Below you see the rendered version of the example module super_repo\\example_google.py

Example Google style docstrings.

SPDX-FileCopyrightText: Copyright (c) 2007-2023 by the Sphinx team SPDX-License-Identifier: BSD-2-Clause

https://www.sphinx-doc.org/en/master/usage/extensions/example_google.html

This module demonstrates documentation as specified by the Google Python Style Guide_. Docstrings may extend over multiple lines. Sections are created with a section header and a colon followed by a block of indented text.

Examples:

Examples can be given using either the Example or Examples sections. Sections support any reStructuredText formatting, including literal blocks::

$ python example_google.py\n

Section breaks are created by resuming unindented text. Section breaks are also implicitly created anytime a new section starts.

Attributes:

Name Type Description module_level_variable1 int

Module level variables may be documented in either the Attributes section of the module docstring, or in an inline docstring immediately following the variable.

Either form is acceptable, but the two should not be mixed. Choose one convention to document module level variables and be consistent with it.

Todo:

* For module TODOs\n* You have to also use ``sphinx.ext.todo`` extension\n

.. _Google Python Style Guide:

http://google.github.io/styleguide/pyguide.html

"},{"location":"user_documentation/code_example/#super_repo.example_google.module_level_variable2","title":"module_level_variable2","text":"

int: Module level variable documented inline.

The docstring may span multiple lines. The type may optionally be specified on the first line, separated by a colon.

"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleClass","title":" ExampleClass ","text":"

The summary line for a class docstring should fit on one line.

If the class has public attributes, they may be documented here in an Attributes section and follow the same formatting as a function's Args section. Alternatively, attributes may be documented inline with the attribute's declaration (see init method below).

Properties created with the @property decorator should be documented in the property's getter method.

Attributes:

Name Type Description attr1 str

Description of attr1.

attr2

obj:int, optional): Description of attr2.

Source code in super_repo/example_google.py
class ExampleClass:\n    \"\"\"The summary line for a class docstring should fit on one line.\n\n    If the class has public attributes, they may be documented here\n    in an ``Attributes`` section and follow the same formatting as a\n    function's ``Args`` section. Alternatively, attributes may be documented\n    inline with the attribute's declaration (see __init__ method below).\n\n    Properties created with the ``@property`` decorator should be documented\n    in the property's getter method.\n\n    Attributes:\n        attr1 (str): Description of `attr1`.\n        attr2 (:obj:`int`, optional): Description of `attr2`.\n\n    \"\"\"\n\n    def __init__(self, param1, param2, param3):\n        \"\"\"Example of docstring on the __init__ method.\n\n        The __init__ method may be documented in either the class level\n        docstring, or as a docstring on the __init__ method itself.\n\n        Either form is acceptable, but the two should not be mixed. Choose one\n        convention to document the __init__ method and be consistent with it.\n\n        Note:\n            Do not include the `self` parameter in the ``Args`` section.\n\n        Args:\n            param1 (str): Description of `param1`.\n            param2 (:obj:`int`, optional): Description of `param2`. Multiple\n                lines are supported.\n            param3 (:obj:`list` of :obj:`str`): Description of `param3`.\n\n        \"\"\"\n        self.attr1 = param1\n        self.attr2 = param2\n        self.attr3 = param3  #: Doc comment *inline* with attribute\n\n        #: list of str: Doc comment *before* attribute, with type specified\n        self.attr4 = [\"attr4\"]\n\n        self.attr5 = None\n        \"\"\"str: Docstring *after* attribute, with type specified.\"\"\"\n\n    @property\n    def readonly_property(self):\n        \"\"\"str: Properties should be documented in their getter method.\"\"\"\n        return \"readonly_property\"\n\n    @property\n    def readwrite_property(self):\n        \"\"\":obj:`list` of :obj:`str`: Properties with both a getter and setter.\n\n        (should only be documented in their getter method)\n\n        If the setter method contains notable behavior, it should be\n        mentioned here.\n        \"\"\"\n        return [\"readwrite_property\"]\n\n    @readwrite_property.setter\n    def readwrite_property(self, value):\n        value\n\n    def example_method(self, param1, param2):\n        \"\"\"\n        Class methods are similar to regular functions.\n\n        Note:\n            Do not include the `self` parameter in the ``Args`` section.\n\n        Args:\n            param1: The first parameter.\n            param2: The second parameter.\n\n        Returns:\n            True if successful, False otherwise.\n\n        \"\"\"\n        return True\n\n    def __special__(self):\n        \"\"\"By default special members with docstrings are not included.\n\n        Special members are any methods or attributes that start with and\n        end with a double underscore. Any special member with a docstring\n        will be included in the output, if\n        ``napoleon_include_special_with_doc`` is set to True.\n\n        This behavior can be enabled by changing the following setting in\n        Sphinx's conf.py::\n\n            napoleon_include_special_with_doc = True\n\n        \"\"\"\n        pass\n\n    def __special_without_docstring__(self):\n        pass\n\n    def _private(self):\n        \"\"\"By default private members are not included.\n\n        Private members are any methods or attributes that start with an\n        underscore and are *not* special. By default they are not included\n        in the output.\n\n        This behavior can be changed such that private members *are* included\n        by changing the following setting in Sphinx's conf.py::\n\n            napoleon_include_private_with_doc = True\n\n        \"\"\"\n        pass\n\n    def _private_without_docstring(self):\n        pass\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleClass.readonly_property","title":"readonly_property property readonly","text":"

str: Properties should be documented in their getter method.

"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleClass.readwrite_property","title":"readwrite_property property writable","text":"

:obj:list of :obj:str: Properties with both a getter and setter.

(should only be documented in their getter method)

If the setter method contains notable behavior, it should be mentioned here.

"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleClass.__init__","title":"__init__(self, param1, param2, param3) special","text":"

Example of docstring on the init method.

The init method may be documented in either the class level docstring, or as a docstring on the init method itself.

Either form is acceptable, but the two should not be mixed. Choose one convention to document the init method and be consistent with it.

Note

Do not include the self parameter in the Args section.

Parameters:

Name Type Description Default param1 str

Description of param1.

required param2

obj:int, optional): Description of param2. Multiple lines are supported.

required param3

obj:list of :obj:str): Description of param3.

required Source code in super_repo/example_google.py
def __init__(self, param1, param2, param3):\n    \"\"\"Example of docstring on the __init__ method.\n\n    The __init__ method may be documented in either the class level\n    docstring, or as a docstring on the __init__ method itself.\n\n    Either form is acceptable, but the two should not be mixed. Choose one\n    convention to document the __init__ method and be consistent with it.\n\n    Note:\n        Do not include the `self` parameter in the ``Args`` section.\n\n    Args:\n        param1 (str): Description of `param1`.\n        param2 (:obj:`int`, optional): Description of `param2`. Multiple\n            lines are supported.\n        param3 (:obj:`list` of :obj:`str`): Description of `param3`.\n\n    \"\"\"\n    self.attr1 = param1\n    self.attr2 = param2\n    self.attr3 = param3  #: Doc comment *inline* with attribute\n\n    #: list of str: Doc comment *before* attribute, with type specified\n    self.attr4 = [\"attr4\"]\n\n    self.attr5 = None\n    \"\"\"str: Docstring *after* attribute, with type specified.\"\"\"\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleClass.__special__","title":"__special__(self) special","text":"

By default special members with docstrings are not included.

Special members are any methods or attributes that start with and end with a double underscore. Any special member with a docstring will be included in the output, if napoleon_include_special_with_doc is set to True.

This behavior can be enabled by changing the following setting in Sphinx's conf.py::

napoleon_include_special_with_doc = True\n
Source code in super_repo/example_google.py
def __special__(self):\n    \"\"\"By default special members with docstrings are not included.\n\n    Special members are any methods or attributes that start with and\n    end with a double underscore. Any special member with a docstring\n    will be included in the output, if\n    ``napoleon_include_special_with_doc`` is set to True.\n\n    This behavior can be enabled by changing the following setting in\n    Sphinx's conf.py::\n\n        napoleon_include_special_with_doc = True\n\n    \"\"\"\n    pass\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleClass.example_method","title":"example_method(self, param1, param2)","text":"

Class methods are similar to regular functions.

Note

Do not include the self parameter in the Args section.

Parameters:

Name Type Description Default param1

The first parameter.

required param2

The second parameter.

required

Returns:

Type Description

True if successful, False otherwise.

Source code in super_repo/example_google.py
def example_method(self, param1, param2):\n    \"\"\"\n    Class methods are similar to regular functions.\n\n    Note:\n        Do not include the `self` parameter in the ``Args`` section.\n\n    Args:\n        param1: The first parameter.\n        param2: The second parameter.\n\n    Returns:\n        True if successful, False otherwise.\n\n    \"\"\"\n    return True\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.ExampleError","title":" ExampleError (Exception) ","text":"

Exceptions are documented in the same way as classes.

The init method may be documented in either the class level docstring, or as a docstring on the init method itself.

Either form is acceptable, but the two should not be mixed. Choose one convention to document the init method and be consistent with it.

Note

Do not include the self parameter in the Args section.

Parameters:

Name Type Description Default msg str

Human readable string describing the exception.

required code

obj:int, optional): Error code.

required

Attributes:

Name Type Description msg str

Human readable string describing the exception.

code int

Exception error code.

Source code in super_repo/example_google.py
class ExampleError(Exception):\n    \"\"\"Exceptions are documented in the same way as classes.\n\n    The __init__ method may be documented in either the class level\n    docstring, or as a docstring on the __init__ method itself.\n\n    Either form is acceptable, but the two should not be mixed. Choose one\n    convention to document the __init__ method and be consistent with it.\n\n    Note:\n        Do not include the `self` parameter in the ``Args`` section.\n\n    Args:\n        msg (str): Human readable string describing the exception.\n        code (:obj:`int`, optional): Error code.\n\n    Attributes:\n        msg (str): Human readable string describing the exception.\n        code (int): Exception error code.\n\n    \"\"\"\n\n    def __init__(self, msg, code):\n        self.msg = msg\n        self.code = code\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.example_generator","title":"example_generator(n)","text":"

Generators have a Yields section instead of a Returns section.

Parameters:

Name Type Description Default n int

The upper limit of the range to generate, from 0 to n - 1.

required

Yields:

Type Description int

The next number in the range of 0 to n - 1.

Examples:

Examples should be written in doctest format, and should illustrate how to use the function.

>>> print([i for i in example_generator(4)])\n[0, 1, 2, 3]\n
Source code in super_repo/example_google.py
def example_generator(n):\n    \"\"\"Generators have a ``Yields`` section instead of a ``Returns`` section.\n\n    Args:\n        n (int): The upper limit of the range to generate, from 0 to `n` - 1.\n\n    Yields:\n        int: The next number in the range of 0 to `n` - 1.\n\n    Examples:\n        Examples should be written in doctest format, and should illustrate how\n        to use the function.\n\n        >>> print([i for i in example_generator(4)])\n        [0, 1, 2, 3]\n\n    \"\"\"\n    for i in range(n):\n        yield i * i\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.function_with_pep484_type_annotations","title":"function_with_pep484_type_annotations(param1, param2)","text":"

Example function with PEP 484 type annotations.

Parameters:

Name Type Description Default param1 int

The first parameter.

required param2 str

The second parameter.

required

Returns:

Type Description bool

The return value. True for success, False otherwise.

Source code in super_repo/example_google.py
def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:\n    \"\"\"Example function with PEP 484 type annotations.\n\n    Args:\n\n        param1: The first parameter.\n        param2: The second parameter.\n\n    Returns:\n\n        The return value. True for success, False otherwise.\n\n    \"\"\"\n    return True\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.function_with_types_in_docstring","title":"function_with_types_in_docstring(param1, param2)","text":"

Example function with types documented in the docstring.

PEP 484 type annotations are supported. If attribute, parameter, and return types are annotated according to PEP 484, they do not need to be included in the docstring:

Parameters:

Name Type Description Default param1 int

The first parameter.

required param2 str

The second parameter.

required

Returns:

Type Description bool

The return value. True for success, False otherwise.

.. _PEP 484:

https://www.python.org/dev/peps/pep-0484/\n
Source code in super_repo/example_google.py
def function_with_types_in_docstring(param1, param2):\n    \"\"\"Example function with types documented in the docstring.\n\n    `PEP 484`_ type annotations are supported. If attribute, parameter, and\n    return types are annotated according to `PEP 484`_, they do not need to be\n    included in the docstring:\n\n    Args:\n\n        param1 (int): The first parameter.\n        param2 (str): The second parameter.\n\n    Returns:\n\n        bool: The return value. True for success, False otherwise.\n\n    .. _PEP 484:\n\n        https://www.python.org/dev/peps/pep-0484/\n\n    \"\"\"\n
"},{"location":"user_documentation/code_example/#super_repo.example_google.module_level_function","title":"module_level_function(param1, param2=None, *args, **kwargs)","text":"

This is an example of a module level function.

Function parameters should be documented in the Args section. The name of each parameter is required. The type and description of each parameter is optional, but should be included if not obvious.

If args or *kwargs are accepted, # noqa they should be listed as *args and **kwargs.

The format for a parameter is::

name (type): description\n    The description may span multiple lines. Following\n    lines should be indented. The \"(type)\" is optional.\n\n    Multiple paragraphs are supported in parameter\n    descriptions.\n

Parameters:

Name Type Description Default param1 int

The first parameter.

required param2

obj:str, optional): The second parameter. Defaults to None. Second line of description should be indented.

None *args

Variable length argument list.

() **kwargs

Arbitrary keyword arguments.

{}

Returns:

Type Description bool

True if successful, False otherwise.

The return type is optional and may be specified at the beginning of the Returns section followed by a colon.

The Returns section may span multiple lines and paragraphs. Following lines should be indented to match the first line.

The Returns section supports any reStructuredText formatting, including literal blocks::

{\n    'param1': param1,\n    'param2': param2\n}\n

Exceptions:

Type Description AttributeError

The Raises section is a list of all exceptions that are relevant to the interface.

ValueError

If param2 is equal to param1.

Source code in super_repo/example_google.py
def module_level_function(param1, param2=None, *args, **kwargs):\n    \"\"\"This is an example of a module level function.\n\n    Function parameters should be documented in the ``Args`` section. The name\n    of each parameter is required. The type and description of each parameter\n    is optional, but should be included if not obvious.\n\n    If *args or **kwargs are accepted, # noqa\n    they should be listed as ``*args`` and ``**kwargs``.\n\n    The format for a parameter is::\n\n        name (type): description\n            The description may span multiple lines. Following\n            lines should be indented. The \"(type)\" is optional.\n\n            Multiple paragraphs are supported in parameter\n            descriptions.\n\n    Args:\n        param1 (int): The first parameter.\n        param2 (:obj:`str`, optional): The second parameter. Defaults to None.\n            Second line of description should be indented.\n        *args: Variable length argument list.\n        **kwargs: Arbitrary keyword arguments.\n\n    Returns:\n        bool: True if successful, False otherwise.\n\n        The return type is optional and may be specified at the beginning of\n        the ``Returns`` section followed by a colon.\n\n        The ``Returns`` section may span multiple lines and paragraphs.\n        Following lines should be indented to match the first line.\n\n        The ``Returns`` section supports any reStructuredText formatting,\n        including literal blocks::\n\n            {\n                'param1': param1,\n                'param2': param2\n            }\n\n    Raises:\n        AttributeError: The ``Raises`` section is a list of all exceptions\n            that are relevant to the interface.\n        ValueError: If `param2` is equal to `param1`.\n\n    \"\"\"\n    if param1 == param2:\n        raise ValueError(\"param1 may not be equal to param2\")\n    return True\n
"},{"location":"user_documentation/install/","title":"Install","text":""},{"location":"user_documentation/install/#environment-conda","title":"Environment (Conda)","text":"

With conda, you can create, export, list, remove, and update environments that have different versions of Python and/or packages installed in them. Switching or moving between environments is called activating the environment. You can also share an environment file and import from \ud83d\udcdd requirements.txt.

\ud83d\udcbb `conda env create -f environment.yaml` Create conda environment <br>\n\ud83d\udcbb `conda activate py310` Activate environment <br>\n\ud83d\udcbb `python --version` Check python version\n

Delete existing environment: \ud83d\udcbb conda deactivate \ud83d\udcbb conda remove --name py310 --all

"},{"location":"user_documentation/install/#requirements","title":"Requirements","text":"

In Python the \ud83d\udcdd requirements.txt file helps manage dependencies. It's a text file that lists the packages that the Python project depends on. All listed packages will be installed in the conda environment.

\ud83d\udcbb pip install -r requirements.txt Install from file

"},{"location":"user_documentation/install/#pyproject","title":"PyProject","text":"

This python package contains a pyproject.toml file that contains build system requirements and information, which are used by pip to build the package. It contains the metadata of the software project.

"},{"location":"user_documentation/install/#astral-uv","title":"astral-uv","text":"

Astral UV is a modern Python package manager designed for flexibility and speed. Efficient package management is crucial for maintaining consistency and compatibility in Python projects. Tools like pip and virtual environments help manage dependencies, while advanced tools like astral-uv streamline package management workflows further. It focuses on optimizing dependency resolution, improving installation times, and ensuring reproducible builds.

Its key features include:

  • Fast Dependency Resolution: Reduces conflicts and speeds up package resolution.
  • Reproducibility: Ensures consistent environments across different machines or deployments.
  • Integration with CI/CD Pipelines: Tailored for seamless integration into automated workflows.

Install: \ud83d\udcbb pip install uv Install package \ud83d\udcbb uv Check package

Use: \ud83d\udcbb uv python list View available Python versions \ud83d\udcbb uv run Run a command in the project environment

Build and publish: \ud83d\udcbb uv build Build the project into distribution archives \ud83d\udcbb ls dist/ View created distribution \ud83d\udcbb uv publish Build the project into distribution archives

See the official documentation at astral.sh

Used Icons

\ud83d\udc19 GitHub | \ud83d\udca0 git | \ud83d\udcdd File | \ud83d\udcbb Command Line

"}]} \ No newline at end of file diff --git a/develop/user_documentation/code_example/index.html b/develop/user_documentation/code_example/index.html index 6350a65..d4b25e1 100644 --- a/develop/user_documentation/code_example/index.html +++ b/develop/user_documentation/code_example/index.html @@ -155,6 +155,43 @@ + + +