Skip to content

Commit

Permalink
Spellcheck update
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyFox892 committed Sep 20, 2024
1 parent 5973068 commit d7d8aaf
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 20 deletions.
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ Functionality
``unknown``.
- Brackets e.g. ``([43]O[4])U[5]``
- Requirement indicators (i.e ``Muss``, ``Soll``, ``Kann``, ``X``,
``O``, ``U``) are seperated from the condition expressions and also
seperated into single requirement indicator expressions if there are
``O``, ``U``) are separated from the condition expressions and also
separated into single requirement indicator expressions if there are
more than one (for modal marks).
- ``Format Constraint Expressions`` that are returned after the
requirement condition evaluation can now be parsed and evaluated.
Expand Down Expand Up @@ -309,13 +309,13 @@ Unknown Neutral Unknown
| | | | of hint and format |
| | | | constraint |
+---------+---------+---------------------+-----------------------+
| Unkown | True | Unknown | |
| Unknown | True | Unknown | |
+---------+---------+---------------------+-----------------------+
| Unkown | False | Unknown | |
| Unknown | False | Unknown | |
+---------+---------+---------------------+-----------------------+
| Unkown | Unknown | Unknown | |
| Unknown | Unknown | Unknown | |
+---------+---------+---------------------+-----------------------+
| Unkown | Neutral | does not make sense | |
| Unknown | Neutral | does not make sense | |
+---------+---------+---------------------+-----------------------+

Link to automatically generate HintsProvider Json content:
Expand Down Expand Up @@ -361,7 +361,7 @@ UTILMD could be a scope. If a condition is described as
There has to be exactly one xyz per Vorgang (SG4+IDE) Then for ``n``
Vorgänge there are ``n`` scopes:

- one scope for each Vorgang (pathes refer to an edifact seed):
- one scope for each Vorgang (path's refer to an edifact seed):

- ``$["Dokument"][0]["Nachricht"][0]["Vorgang"][0]``
- ``$["Dokument"][0]["Nachricht"][0]["Vorgang"][1]``
Expand Down
7 changes: 6 additions & 1 deletion domain-specific-terms.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# contains 1 lower case word per line which are ignored in the spell_check
Dokument
ist
oder
oder
CONTRL
oll
BU
adresse
alle
2 changes: 1 addition & 1 deletion src/ahbicht/content_evaluation/fc_evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def evaluate_931(self, entered_input: str) -> EvaluatedFormatConstraint:
Then assert that the UTC offset is exactly +00:00.
Be aware of the fact that asserting on a fixed offset when both datetime + offset are given will not lead to any
truly meaningful results.
We implement it for compatability but don't encourage you to actively write any conditions that use it.
We implement it for compatibility but don't encourage you to actively write any conditions that use it.
"""
return has_no_utc_offset(entered_input)

Expand Down
2 changes: 1 addition & 1 deletion src/ahbicht/content_evaluation/token_logic_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SingletonTokenLogicProvider(TokenLogicProvider):
@staticmethod
def _to_key(edifact_format: Optional[EdifactFormat], format_version: Optional[EdifactFormatVersion]) -> str:
"""
because a tuple for format and format version is not hashable / usuable as key in a dict this methods
because a tuple for format and format version is not hashable / usable as key in a dict this methods
converts them to a unique and hashable string
"""
if edifact_format is None or format_version is None:
Expand Down
4 changes: 2 additions & 2 deletions src/ahbicht/expressions/ahb_expression_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class AhbExpressionTransformer(Transformer):
"""
Transformer, that evaluates the trees built from the ahb expressions.
The input are the conditions as defined in the AHBs in the form of ConditionNodes.
It returns a list of the seperated requirement indicators with
It returns a list of the separated requirement indicators with
their respective condition expressions already evaluated to booleans.
"""

Expand Down Expand Up @@ -63,7 +63,7 @@ def single_requirement_indicator_expression(
) -> Awaitable[AhbExpressionEvaluationResult]:
"""
Evaluates the condition expression of the respective requirement indicator expression and returns a list of the
seperated requirement indicators with their results of the condition check.
separated requirement indicators with their results of the condition check.
"""
return self._single_requirement_indicator_expression_async(requirement_indicator, condition_expression)

Expand Down
2 changes: 1 addition & 1 deletion src/ahbicht/expressions/base_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class BaseTransformer(Transformer, ABC, Generic[SupportedArgumentNode, Supported
After two nodes are evaluated in a composition, the resulting node has the node type EvalutatedComposition.
The return value is a ConditionNode whose attribute `format_constraint_fulfilled` describes whether
the format constraint expression is fulfiled or not.
the format constraint expression is fulfilled or not.
"""

def __init__(self, input_values: Mapping[str, SupportedArgumentNode]):
Expand Down
2 changes: 1 addition & 1 deletion src/ahbicht/expressions/condition_expression_parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This module parses a condition expression like "[59] U ([123] O [456])" into a tree structur using
This module parses a condition expression like "[59] U ([123] O [456])" into a tree structure using
the parsing library lark: https://lark-parser.readthedocs.io/en/latest/
The used terms are defined in the README_conditions.md.
Expand Down
2 changes: 1 addition & 1 deletion src/ahbicht/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
async def gather_if_necessary(results_and_awaitable_results: List[Union[Result, Awaitable[Result]]]) -> List[Result]:
"""
Await the awaitables, pass the un-awaitable results
:param results_and_awaitable_results: heterogenous list of both Ts and Awaitable[T]s.
:param results_and_awaitable_results: heterogeneous list of both Ts and Awaitable[T]s.
:return: list of T in the same order as in the input param.
"""
awaitable_indexes = [n for n, x in enumerate(results_and_awaitable_results) if inspect.isawaitable(x)]
Expand Down
4 changes: 2 additions & 2 deletions src/ahbicht/validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ async def validate_data_element_valuepool(
if data_element.entered_input in possible_values:
requirement_validation_data_element = RequirementValidationValue.IS_REQUIRED_AND_FILLED
elif data_element.entered_input:
fc_validation_result = False # we re-use the fc validation field to mark that the value is unexpected
fc_validation_result = False # we reuse the fc validation field to mark that the value is unexpected
requirement_validation_data_element = RequirementValidationValue.IS_REQUIRED_AND_EMPTY
hints = f"Der Wert '{data_element.entered_input}' ist nicht in: {{{', '.join(possible_values.keys())}}}"
data_element.entered_input = None # overwrite the illegal value
Expand Down Expand Up @@ -437,7 +437,7 @@ def map_requirement_validation_values(
# https://github.com/Hochfrequenz/ahbicht/issues/275
raise NotImplementedError(
# pylint:disable=line-too-long
"It's unknown if the requirement constraints are met (most likely because at least one node evaluated to UNKNONW. A validation is meaningless in this case."
"It's unknown if the requirement constraints are met (most likely because at least one node evaluated to UNKNOWN. A validation is meaningless in this case."
)
if requirement_indicator is ModalMark.KANN or requirement_indicator is ModalMark.SOLL:
requirement_validation = RequirementValidationValue.IS_OPTIONAL
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ deps =
{[testenv:tests]deps}
.[spellcheck]
commands =
codespell --ignore-words=domain-specific-terms.txt
codespell --ignore-words=domain-specific-terms.txt --skip .\docs\_static\ahbicht-logo-raw.svg
# add single files (ending with .py) or packages here

[testenv:dev]
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_condition_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def test_parse_valid_expression_to_tree(self, expression: str, expected_tree: Tr
def test_parse_valid_expression_to_tree_with_format_constraints(self, expression: str, expected_tree: Tree):
"""
Tests that valid expressions containing operators "O" and "U", different whitespaces
and no brackets are parsed as expected. It is similiar to the test `test_parse_valid_expression_to_tree`
and no brackets are parsed as expected. It is similar to the test `test_parse_valid_expression_to_tree`
but it adds format constraints.
"""
parsed_tree = parse_condition_expression_to_tree(expression)
Expand Down
2 changes: 1 addition & 1 deletion unittests/test_evaluator_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class TestEvaluatorProvider:
"""
Test that the list based evalutor provider works as expected
Test that the list based evaluator provider works as expected
"""

def test_initialization(self):
Expand Down

0 comments on commit d7d8aaf

Please sign in to comment.