From 801aba2612598f6a569bad6660197d1980789d1f Mon Sep 17 00:00:00 2001 From: develop-cs <43383361+develop-cs@users.noreply.github.com> Date: Mon, 10 Jun 2024 11:04:00 +0200 Subject: [PATCH] Feature/docs_fixes (#17) * fix: fix links Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * fix: use true YAML boolean values Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> --------- Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> --- CHANGELOG.md | 2 +- CONTRIBUTING.md | 2 +- README.md | 13 ++++++++----- docs/pages/a_simple_example.md | 6 +++--- .../missing_action_source_modules.yaml | 4 ++-- .../missing_condition_source_modules.yaml | 4 ++-- .../missing_conditions/missing_conditions.yaml | 4 ++-- .../without_parsing_error_strategy.yaml | 4 ++-- .../failing_conf/wrong_action/wrong_action.yaml | 4 ++-- .../wrong_condition/wrong_condition.yaml | 4 ++-- .../wrong_parsing_error_strategy.yaml | 4 ++-- .../wrong_rules_nested/wrong_rules_nested.yaml | 4 ++-- .../wrong_validation_function.yaml | 4 ++-- tests/examples/good_conf/rules.yaml | 4 ++-- tests/examples/good_conf/rules_bis.yaml | 12 ++++++------ .../simple_cond_conf/default/rules_simple_cond.yaml | 4 ++-- .../ignore/rules_simple_cond_ignore.yaml | 4 ++-- .../raise/rules_simple_cond_raise.yaml | 4 ++-- .../wrong/dummy/ignore/rules_simple_dummy.yaml | 4 ++-- .../wrong/ignore/rules_simple_wrong_ignore.yaml | 4 ++-- .../wrong/raise/rules_simple_wrong_raise.yaml | 4 ++-- 21 files changed, 51 insertions(+), 48 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c016135..adb2ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,4 +7,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [0.7.0b] - April, 2024 ### New Features -- Beta release implementing what you can find in its [documentation](https://pages.github.com/MAIF/arta/home). +- Beta release implementing what you can find in its [documentation](https://maif.github.io/arta/home/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 601ed7d..e61c989 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,7 +22,7 @@ We follow the standard GitHub [fork & pull](https://help.github.com/articles/usi - Please make sure to follow the general quality guidelines (specified below) when developing your patch. - Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull request. 1. Once your feature is complete, prepare the commit with a good commit message, for example: `Adding canary mode support for services #42` (note the reference to the ticket it aimed to resolve). -1. If it's a new feature, or a change of behaviour, document it on the [Arta docs](https://pages.github.com/MAIF/arta/home), remember, an undocumented feature is not a feature. +1. If it's a new feature, or a change of behaviour, document it on the [Arta docs](https://maif.github.io/arta/home/), remember, an undocumented feature is not a feature. 1. Now it's finally time to [submit the pull request](https://help.github.com/articles/using-pull-requests)! - Please make sure to include a reference to the issue you're solving *in the comment* for the Pull Request, this will cause the PR to be linked properly with the Issue. Examples of good phrases for this are: "Resolves #1234" or "Refs #1234". 1. Now both committers and interested people will review your code. This process is to ensure the code we merge is of the best possible quality, and that no silly mistakes slip through. You're expected to follow-up these comments by adding new commits to the same branch. The commit messages of those commits can be more loose, for example: `Removed debugging using printline`, as they all will be squashed into one commit before merging into the main branch. diff --git a/README.md b/README.md index da04048..10ef932 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ --- -**Documentation:** [https://pages.github.com/MAIF/arta/home](https://pages.github.com/MAIF/arta/home) +**Documentation:** [https://maif.github.io/arta/home/](https://maif.github.io/arta/home/) **Repository:** [https://github.com/MAIF/arta](https://github.com/MAIF/arta) @@ -60,12 +60,12 @@ rules: simple_condition: input.power=="strength" or input.power=="fly" action: set_admission action_parameters: - value: True + value: true NOT_ADMITTED: simple_condition: null action: set_admission action_parameters: - value: False + value: false actions_source_modules: - actions @@ -74,6 +74,9 @@ actions_source_modules: `actions.py` : ```python +from typing import Any + + def set_admission(value: bool, **kwargs: Any) -> dict[str, bool]: """Return a dictionary containing the admission result.""" return {"is_admitted": value} @@ -105,11 +108,11 @@ print(result) You should get: `{"admission": {"is_admitted": True}}` -Check the [A Simple Example](https://pages.github.com/MAIF/arta/a_simple_example/) section for more details. +Check the [A Simple Example](https://maif.github.io/arta/a_simple_example/) section for more details. ## Installation -Install using `pip install -U arta`. See the [Install](https://pages.github.com/MAIF/arta/installation/) section in the documentation for more details. +Install using `pip install -U arta`. See the [Install](https://maif.github.io/arta/installation/) section in the documentation for more details. ## What's New diff --git a/docs/pages/a_simple_example.md b/docs/pages/a_simple_example.md index a063be4..27f58a3 100644 --- a/docs/pages/a_simple_example.md +++ b/docs/pages/a_simple_example.md @@ -46,12 +46,12 @@ rules: simple_condition: input.power=="strength" or input.power=="fly" action: set_admission action_parameters: - value: True + value: true NOT_ADMITTED: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: FRENCH: simple_condition: input.language=="french" and input.age!=None @@ -94,7 +94,7 @@ An **action** is triggered when the conditions are verified (i.e., `True`). ```yaml action: set_admission # (1) action_parameters: # (2) - value: True + value: true ``` 1. Name of the *python callable object* used as an **action function**. diff --git a/tests/examples/failing_conf/missing_action_source_modules/missing_action_source_modules.yaml b/tests/examples/failing_conf/missing_action_source_modules/missing_action_source_modules.yaml index ffa5175..76a96fc 100644 --- a/tests/examples/failing_conf/missing_action_source_modules/missing_action_source_modules.yaml +++ b/tests/examples/failing_conf/missing_action_source_modules/missing_action_source_modules.yaml @@ -23,9 +23,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/missing_condition_source_modules/missing_condition_source_modules.yaml b/tests/examples/failing_conf/missing_condition_source_modules/missing_condition_source_modules.yaml index ac4e805..84ae3d3 100644 --- a/tests/examples/failing_conf/missing_condition_source_modules/missing_condition_source_modules.yaml +++ b/tests/examples/failing_conf/missing_condition_source_modules/missing_condition_source_modules.yaml @@ -23,9 +23,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/missing_conditions/missing_conditions.yaml b/tests/examples/failing_conf/missing_conditions/missing_conditions.yaml index f8b2481..0aced67 100644 --- a/tests/examples/failing_conf/missing_conditions/missing_conditions.yaml +++ b/tests/examples/failing_conf/missing_conditions/missing_conditions.yaml @@ -13,9 +13,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/without_parsing_error_strategy/without_parsing_error_strategy.yaml b/tests/examples/failing_conf/without_parsing_error_strategy/without_parsing_error_strategy.yaml index f378128..970c4b9 100644 --- a/tests/examples/failing_conf/without_parsing_error_strategy/without_parsing_error_strategy.yaml +++ b/tests/examples/failing_conf/without_parsing_error_strategy/without_parsing_error_strategy.yaml @@ -25,9 +25,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/wrong_action/wrong_action.yaml b/tests/examples/failing_conf/wrong_action/wrong_action.yaml index 8cb8b11..a17f530 100644 --- a/tests/examples/failing_conf/wrong_action/wrong_action.yaml +++ b/tests/examples/failing_conf/wrong_action/wrong_action.yaml @@ -25,9 +25,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: dummy_funct action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/wrong_condition/wrong_condition.yaml b/tests/examples/failing_conf/wrong_condition/wrong_condition.yaml index a0bb2e9..fbc2fe5 100644 --- a/tests/examples/failing_conf/wrong_condition/wrong_condition.yaml +++ b/tests/examples/failing_conf/wrong_condition/wrong_condition.yaml @@ -25,9 +25,9 @@ rules: condition: DUMMY_CONDITION action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/wrong_parsing_error_strategy/wrong_parsing_error_strategy.yaml b/tests/examples/failing_conf/wrong_parsing_error_strategy/wrong_parsing_error_strategy.yaml index 84fcb49..d1ebd77 100644 --- a/tests/examples/failing_conf/wrong_parsing_error_strategy/wrong_parsing_error_strategy.yaml +++ b/tests/examples/failing_conf/wrong_parsing_error_strategy/wrong_parsing_error_strategy.yaml @@ -27,9 +27,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/wrong_rules_nested/wrong_rules_nested.yaml b/tests/examples/failing_conf/wrong_rules_nested/wrong_rules_nested.yaml index f53784b..67cd2d8 100644 --- a/tests/examples/failing_conf/wrong_rules_nested/wrong_rules_nested.yaml +++ b/tests/examples/failing_conf/wrong_rules_nested/wrong_rules_nested.yaml @@ -25,9 +25,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER dummy: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/failing_conf/wrong_validation_function/wrong_validation_function.yaml b/tests/examples/failing_conf/wrong_validation_function/wrong_validation_function.yaml index 87be6f4..0ae9eb2 100644 --- a/tests/examples/failing_conf/wrong_validation_function/wrong_validation_function.yaml +++ b/tests/examples/failing_conf/wrong_validation_function/wrong_validation_function.yaml @@ -25,9 +25,9 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false diff --git a/tests/examples/good_conf/rules.yaml b/tests/examples/good_conf/rules.yaml index 7e2c038..d985237 100644 --- a/tests/examples/good_conf/rules.yaml +++ b/tests/examples/good_conf/rules.yaml @@ -7,12 +7,12 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: condition: IS_SPEAKING_ENGLISH and not(IS_AGE_UNKNOWN) diff --git a/tests/examples/good_conf/rules_bis.yaml b/tests/examples/good_conf/rules_bis.yaml index 24f16f2..15ff75d 100644 --- a/tests/examples/good_conf/rules_bis.yaml +++ b/tests/examples/good_conf/rules_bis.yaml @@ -8,13 +8,13 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: custom_condition: null condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_FRENCH: custom_condition: null @@ -57,13 +57,13 @@ rules: condition: HAS_SCHOOL_AUTHORIZED_POWER action: set_admission action_parameters: - value: True + value: true ADM_KO: custom_condition: null condition: null action: set_admission action_parameters: - value: False + value: false # Fourth rule set fourth_rule_set: admission_rules: @@ -72,10 +72,10 @@ rules: condition: null action: set_admission action_parameters: - value: True + value: true ADM_KO: custom_condition: null condition: null action: set_admission action_parameters: - value: False \ No newline at end of file + value: false \ No newline at end of file diff --git a/tests/examples/simple_cond_conf/default/rules_simple_cond.yaml b/tests/examples/simple_cond_conf/default/rules_simple_cond.yaml index 8a31986..08a712e 100644 --- a/tests/examples/simple_cond_conf/default/rules_simple_cond.yaml +++ b/tests/examples/simple_cond_conf/default/rules_simple_cond.yaml @@ -11,12 +11,12 @@ rules: simple_condition: input.power=="strength" or input.power=="fly" action: set_admission action_parameters: - value: True + value: true ADM_KO: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: simple_condition: input.language=="english" and input.age!=None diff --git a/tests/examples/simple_cond_conf/ignore/rules_simple_cond_ignore.yaml b/tests/examples/simple_cond_conf/ignore/rules_simple_cond_ignore.yaml index 26620aa..249abbc 100644 --- a/tests/examples/simple_cond_conf/ignore/rules_simple_cond_ignore.yaml +++ b/tests/examples/simple_cond_conf/ignore/rules_simple_cond_ignore.yaml @@ -13,12 +13,12 @@ rules: simple_condition: input.power=="strength" or input.power=="fly" action: set_admission action_parameters: - value: True + value: true ADM_KO: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: simple_condition: input.language=="english" and input.age!=None diff --git a/tests/examples/simple_cond_conf/raise/rules_simple_cond_raise.yaml b/tests/examples/simple_cond_conf/raise/rules_simple_cond_raise.yaml index eac0f02..b309377 100644 --- a/tests/examples/simple_cond_conf/raise/rules_simple_cond_raise.yaml +++ b/tests/examples/simple_cond_conf/raise/rules_simple_cond_raise.yaml @@ -13,12 +13,12 @@ rules: simple_condition: input.power=="strength" or input.power=="fly" action: set_admission action_parameters: - value: True + value: true ADM_KO: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: simple_condition: input.language=="english" and input.age!=None diff --git a/tests/examples/simple_cond_conf/wrong/dummy/ignore/rules_simple_dummy.yaml b/tests/examples/simple_cond_conf/wrong/dummy/ignore/rules_simple_dummy.yaml index 4b01545..80279b7 100644 --- a/tests/examples/simple_cond_conf/wrong/dummy/ignore/rules_simple_dummy.yaml +++ b/tests/examples/simple_cond_conf/wrong/dummy/ignore/rules_simple_dummy.yaml @@ -13,12 +13,12 @@ rules: simple_condition: input.age=="strength" or dummy action: set_admission action_parameters: - value: True + value: true ADM_KO: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: simple_condition: input.language=="english" and input.age!=None diff --git a/tests/examples/simple_cond_conf/wrong/ignore/rules_simple_wrong_ignore.yaml b/tests/examples/simple_cond_conf/wrong/ignore/rules_simple_wrong_ignore.yaml index 93f2672..e2289c5 100644 --- a/tests/examples/simple_cond_conf/wrong/ignore/rules_simple_wrong_ignore.yaml +++ b/tests/examples/simple_cond_conf/wrong/ignore/rules_simple_wrong_ignore.yaml @@ -13,12 +13,12 @@ rules: simple_condition: input.power=="strength" or input.dummy=="fly" action: set_admission action_parameters: - value: True + value: true ADM_KO: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: simple_condition: input.language=="english" and input.age!=None diff --git a/tests/examples/simple_cond_conf/wrong/raise/rules_simple_wrong_raise.yaml b/tests/examples/simple_cond_conf/wrong/raise/rules_simple_wrong_raise.yaml index 0ac859d..1e10247 100644 --- a/tests/examples/simple_cond_conf/wrong/raise/rules_simple_wrong_raise.yaml +++ b/tests/examples/simple_cond_conf/wrong/raise/rules_simple_wrong_raise.yaml @@ -13,12 +13,12 @@ rules: simple_condition: input.power=="strength" or input.dummy=="fly" action: set_admission action_parameters: - value: True + value: true ADM_KO: simple_condition: null action: set_admission action_parameters: - value: False + value: false course: COURSE_ENGLISH: simple_condition: input.language=="english" and input.age!=None