diff --git a/.github/workflows/new_problem_check.yml b/.github/workflows/new_problem_check.yml index 5a13ee6..5f2917c 100644 --- a/.github/workflows/new_problem_check.yml +++ b/.github/workflows/new_problem_check.yml @@ -2,6 +2,8 @@ name: New Problem Check on: push: + branches: + - main paths: - "utils/new_problem.yaml" pull_request: @@ -32,6 +34,7 @@ jobs: pip install -r utils/requirements.txt - name: Run New Problem Check + if: ${{ hashFiles('utils/new_problem.yaml') != '' }} run: | python utils/validate_yaml.py utils/new_problem.yaml diff --git a/utils/README.md b/utils/README.md index 3d3fbee..2ad9e5e 100644 --- a/utils/README.md +++ b/utils/README.md @@ -4,7 +4,7 @@ This folder contains utility scripts for working with the YAML format to describ The intended way of adding a new problem to the repository is thus as follows: -* Change the [new_problem.yaml](new_problem.yaml) template file to fit the new problem. +* Create a file in 'utils/new_problem.yaml' based on the template (see below). * Create a PR with the changes (for example with a fork). What happens in the background then is: @@ -13,7 +13,7 @@ What happens in the background then is: * Then the PR should be reviewed manually. * When the PR is merged into the main branch, a second script runs (which doesn't exist yet), that adds the content of [new_problem.yaml](new_problem.yaml) to the [problems.yaml](../problems.yaml) file, and reverts the changes to the new_problem.yaml. -:alert: Note that the GitHubActions do not exist yet either, this is a WIP. +:warning: Note that the GitHubActions do not exist yet either, this is a WIP. ## validate_yaml.py @@ -23,9 +23,27 @@ This script checks the new content for the following: * The required fields are present. * Specific fields are unique across the new set of problems (e.g. name) -:alert: Execute from root of the repository. Tested with python 3.12 +:warning: Execute from root of the repository. Tested with python 3.12 ```bash pip install -r utils/requirements.txt python utils/validate_yaml.py utils/new_problem.yaml ``` + +## new problem example + +```yaml +- name: example-problem-name + suite/generator/single: suite + objectives: '1' + dimensionality: scalable + variable type: continuous + constraints: 'no' + dynamic: 'no' + noise: 'no' + multimodal: 'yes' + multi-fidelity: 'no' + reference: '' + implementation: '' + source (real-world/artificial): '' + textual description: 'This is a dummy template' diff --git a/utils/new_problem.yaml b/utils/new_problem.yaml deleted file mode 100644 index 2c300e1..0000000 --- a/utils/new_problem.yaml +++ /dev/null @@ -1,14 +0,0 @@ -- name: template - suite/generator/single: suite - objectives: '2' - dimensionality: scalable - variable type: continuous - constraints: 'no' - dynamic: 'no' - noise: 'no' - multimodal: 'yes' - multi-fidelity: 'no' - reference: '' - implementation: '' - source (real-world/artificial): '' - textual description: 'This is a dummy template'