Skip to main content

No project description provided

Project description

preCICE Config Checker

A library that checks a preCICE configuration file for logical errors.

How does this differ from precice-tools check? This checker only checks the configuration for logical errors.

[!NOTE] This checker assumes that precice-tools check (before preCICE version 3.3.0) or precice-config-validate (after preCICE version 3.3.0) has already been executed without an error on the configuration file.
Otherwise, the behavior of this checker is undefined.

Requirements

Installation

  1. Clone this repository:
git clone https://github.com/precice/config-check
cd config-check
  1. Create a new Python Virtual Environment (optional, but recommended):
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  1. Install required dependencies:
pip install .

You need to force re-install the precice_config_graph-dependency on new versions, since it is downloaded directly from GitHub. To do so, run:

pip install --ignore-installed .

Project Structure

config-check
├── .github, .idea, etc…
│
├── docs                       # Documentation on rules and the inner workings of this checker
│   └── ...
│
├── preciceconfigcheck         # Main library files
│   ├── rules                  # All rules that are checked by this utility
│   │   ├── ...
│   │   └── examples           # Exemplary implementations of rules to test output format
│   │       └── ...
│   │
│   ├── tests                  # Configuration files to test rules
│   │   └── ...
│   │
│   ├── cli.py                 # Main entrypoint for this checker
│   ├── color.py               # Definition of colors for CLI output
│   ├── rule.py                # Class of a rule and logic to check all rules
│   ├── rules_processing.py    # Processes rules and handles output
│   ├── rules_utils.py         # Utility functions for rules
│   ├── severity.py            # Enum for specifying severity of output
│   └── violation.py           # Class of a violation
│
│
├── .gitignore, LICENSE, README.md
│
├── pyproject.toml             # Project configuration (dependencies etc.)
└── shell.nix                  # Dependencies for anyone using NixOS / the nix-package manager. Should be replaced by a flake in the future.

Checking a preCICE config

To check a preCICE configuration file for logical errors, run the following within the root of this repository:

python -m preciceconfigcheck.cli "path/to/precice-config.xml"

If you want more information about the checks that were performed and their results, use

python -m preciceconfigcheck.cli "path/to/precice-config.xml" --debug

Suggesting new Rules

We are always open to suggestions for new rules. When encountering a logical error that does not already get reviewed by our checker, please create a new issue on our GitHub repository and:

  • Check that the problem is not already under development (marked with TODO in docs/Rules.md)
  • Explain the problem:
    • What exactly is the problem?
    • Why is it a problem?
    • Are there cases when this setup is valid?
    • Please also provide a precice-config.xmlfile with the error you described and one with a fix of how it should be

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

precice_config_check-1.0.3.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

precice_config_check-1.0.3-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file precice_config_check-1.0.3.tar.gz.

File metadata

  • Download URL: precice_config_check-1.0.3.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for precice_config_check-1.0.3.tar.gz
Algorithm Hash digest
SHA256 8ebf7b7857de84f2ff685c4beaf669c2d83c645aff193c8df963e5e443b9c692
MD5 7efdadfff0913b5a34538d9b3a8d5d0a
BLAKE2b-256 273c7b3f1609ab6062b2521729d6284983777cab610c6dc6d9247ff3c065f519

See more details on using hashes here.

Provenance

The following attestation bundles were made for precice_config_check-1.0.3.tar.gz:

Publisher: release.yml on precice/config-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file precice_config_check-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for precice_config_check-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fe9067b4a502226117559148b1795347a276bd4b86d322ca25f57a75b62c4257
MD5 70cee0c7af69d8dae53636a38f15b0e0
BLAKE2b-256 a355c5e1c234a0847a37a08658182fdac0d6df6e3ba99c228c483dd8860ec310

See more details on using hashes here.

Provenance

The following attestation bundles were made for precice_config_check-1.0.3-py3-none-any.whl:

Publisher: release.yml on precice/config-check

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page