Skip to content

Commit

Permalink
Feature/doc_fix (#34)
Browse files Browse the repository at this point in the history
* docs: fix simple example (#33)

Signed-off-by: develop-cs <[email protected]>

* docs: update changelog

Signed-off-by: develop-cs <[email protected]>

---------

Signed-off-by: develop-cs <[email protected]>
  • Loading branch information
develop-cs authored Sep 5, 2024
1 parent 4f1bf9d commit b7b8938
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 62 deletions.
13 changes: 6 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,27 @@ about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**:
### Describe the bug
A clear and concise description of what the bug is.

**To Reproduce**:
### To Reproduce
Steps to reproduce the behavior:
1. Import '...'
2. Call '....'
3. See error

**Expected behavior**:
### Expected behavior
A clear and concise description of what you expected to happen.

**Screenshots**:
### Screenshots
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
### Desktop (please complete the following information)
- OS: `[e.g. linux]`
- Python version(s): `[e.g. 3.12]`
- Dependencies versions: `[e.g. pydantic 2.6.4]`

**Additional context**:
### Additional context
Add any other context about the problem here.
9 changes: 4 additions & 5 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe**:
### Is your feature request related to a problem? Please describe
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**:
### Describe the solution you'd like
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**:
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**:
### Additional context
Add any other context or screenshots about the feature request here.
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
## What?
### What?
Explain with one or more sentences what this change is doing.

## Have you done?
### Have you done?
- [ ] Code tests
- [ ] Update documentation
- [ ] Update [changelog](https://github.com/MAIF/arta/blob/main/CHANGELOG.md)

## Details to be checked: (optional)
### Details to be checked: (optional)
If needed, add some details here in order to verify the change (e.g., how to test).

## Linked issues: (optional)
### Linked issues: (optional)
- Close ...
- Close ...
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ repos:
- id: end-of-file-fixer
exclude: ^(docs/)
- id: pretty-format-json
args: ['--autofix']
args: [--autofix]
- id: trailing-whitespace
args: ['--markdown-linebreak-ext=md']
args: [--markdown-linebreak-ext=md]
exclude: ^(docs/)
- id: mixed-line-ending
args: ['--fix=lf']
args: [--fix=lf]
exclude: ^(docs/)
- id: check-added-large-files
args: ['--maxkb=500']
args: [--maxkb=500]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.4
rev: v0.6.3
hooks:
- id: ruff
args: [ --fix ]
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.0
rev: v1.11.2
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
Expand All @@ -46,9 +46,9 @@ repos:
rev: v2.7.3
hooks:
- id: pip-audit
args: ["--skip-editable"]
args: [--skip-editable]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.3.0
rev: v3.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
Expand All @@ -65,6 +65,6 @@ repos:
name: Coverage
language: system
entry: pytest -v --cov=arta --cov-fail-under=90
types: [ python ]
types: [python]
pass_filenames: false
always_run: true
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [0.8.1] - September, 2024

### Fixes

* *Simple condition:* an error occurs when the field is of type camelcase or pascalcase (e.g., `input.streetNumber`, `input.StreetNumber`).
* *Simple condition:* an error occurs (#31) when the field is of type `camelCase` or `PascalCase` (e.g., `input.streetNumber`, `input.StreetNumber`).

### Documentation

* Fixes of code in the [A Simple Example](https://maif.github.io/arta/a_simple_example/) page.

## [0.8.0] - July, 2024

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

## Overview

**Arta** is a simple python rules engine designed for python developers.
**Arta** is an *open source* python rules engine designed for and by python developers.

### Goal

Expand Down Expand Up @@ -113,7 +113,13 @@ Check the [A Simple Example](https://maif.github.io/arta/a_simple_example/) sect

## Installation

Install using `pip install -U arta`. See the [Install](https://maif.github.io/arta/installation/) section in the documentation for more details.
Install using `pip install -U`:

```shell
pip install -U arta
```

See the [Install](https://maif.github.io/arta/installation/) section in the documentation for more details.

## What's New

Expand Down
13 changes: 8 additions & 5 deletions docs/pages/a_simple_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Imagine the following use case:

The rules (intentionally simple) are:

``` mermaid
```mermaid
---
title: Simple rule set example
---
Expand Down Expand Up @@ -69,17 +69,17 @@ rules:
simple_condition: input.language=="french" and input.age!=None
action: set_course
action_parameters:
value: french
course_id: french
SENIOR:
simple_condition: input.age==None
action: set_course
action_parameters:
value: senior
course_id: senior
INTERNATIONAL:
simple_condition: input.language!="french"
action: set_course
action_parameters:
value: international
course_id: international
favorite_meal:
EMAIL:
simple_condition: input.favorite_meal!=None
Expand Down Expand Up @@ -124,6 +124,9 @@ actions_source_modules:
And could be for example (intentionally simple) in `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}
Expand All @@ -134,7 +137,7 @@ def set_course(course_id: str, **kwargs: Any) -> dict[str, str]:
return {"course_id": course_id}
def send_email(mail_to: str, mail_content: str, meal: str, **kwargs: Any) -> bool:
def send_email(mail_to: str, mail_content: str, meal: str, **kwargs: Any) -> str | None:
"""Send an email."""
result: str | None = None
Expand Down
7 changes: 4 additions & 3 deletions docs/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@
<div class="row contentN2">
<div class="col-md-8 col-xs-12 colDashRight">
<ul class="titleOnLine">
<li>An Open Source</li>
<li>A Python</li>
<li>Rules Engine:</li>
<li>Make rule handling simple</li>
<li>Make rule handling</li>
<li>simple</li>
</ul>
<p class="intro">
Arta is a simple python rules engine designed for python developers.</br></br>
Arta is an open source python rules engine designed for and by python developers.</br></br>
There is one main reason to use <i>Arta</i> and it was the main goal of its development
at <i>MAIF</i>: <b>increase business rules maintainability</b>.
</br>
Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"

[project]
name = "arta"
version = "0.8.0"
version = "0.8.1"
requires-python = ">3.8.0"
description = "An Open Source Rules Engine - Make rule handling simple"
description = "A Python Rules Engine - Make rule handling simple"
readme = "README.md"
license = {text = "Apache-2.0"}
authors = [
Expand Down Expand Up @@ -34,7 +34,6 @@ classifiers = [
dependencies = [
"omegaconf>=2.0.0",
"pydantic>=1.0.0",
"urllib3!=2.2.1",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ rules:
action_parameters:
list_str:
- OK
camelCase :
camelcase:
RULE_1:
simple_condition: input.streetNumber>0 and input.streetName!="" and input.postalCode >0
simple_condition: input.streetNumber>0 and input.streetName!="" and input.PostalCode>0
action: concatenate_str
action_parameters:
list_str:
- OK
RULE_2:
action: concatenate_str
action_parameters:
list_str:
- KO
Loading

0 comments on commit b7b8938

Please sign in to comment.