Here the adapter configuration schema is stored, together with validation utility.
A schema ...
- defines how a configuration file looks like (thus replaces any explicit documentation).
- enables interoperability (through standardization).
- simplifies auto-generation.
- enables tooling support (e.g. IDEs or GUIs).
- enables automatic LLM-based conversion from and to other configuration languages.
- ...
Install the package using pip:
pip install precice-adapter-schemaFor development, install in editable mode:
pip install -e .The preciceadapterschema package provides a validate function to validate preCICE adapter configurations against the JSON schema.
import preciceadapterschema
# Your configuration data
config_data = {
}
# Validate the configuration
try:
preciceadapterschema.validate(config_data)
print("Configuration is valid!")
except Exception as e:
print(f"Validation failed: {e}")The schema file (precice_adapter_config.schema.json) is included in the package and loaded automatically by the validate function.
We recommend using MetaConfigurator to create and edit preCICE adapter configurations. It provides a user-friendly interface and ensures that your configurations are always valid according to the schema.
Run tests using unittest:
python -m unittest discover -s tests -v