Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add condition field to AHBLine #410

Merged
merged 6 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ahbicht
attrs>=22.1.0
Copy link
Contributor

@hf-kklein hf-kklein Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bitte auch in der pyproject.toml ergänzen. edit: ich glaube du brauchst es hier nicht. denn wir nutzen den parser von ahbicht nicht. dann haben wir auch keinen zirkel-bezug zwischen maus und ahbicht

marshmallow
lxml>=4.9.2
Expand Down
33 changes: 28 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
#
attrs==23.2.0
ahbicht==0.8.4
# via -r requirements.in
attrs==23.2.0
# via
# -r requirements.in
# ahbicht
# maus
click==8.1.7
# via -r requirements.in
colorama==0.4.6
# via click
inject==5.2.1
# via ahbicht
lark==1.1.9
# via -r requirements.in
# via
# -r requirements.in
# ahbicht
lxml==5.2.2
# via -r requirements.in
marshmallow==3.21.2
# via -r requirements.in
# via
# -r requirements.in
# ahbicht
# marshmallow-enum
# maus
marshmallow-enum==1.5.1
# via ahbicht
maus==0.5.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erm... wie gehen wir damit um? dass es diese kreis-abhängigkeit gibt @hf-krechan @lord-haffi ?

Copy link
Contributor

@lord-haffi lord-haffi Jun 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hf-kklein Eine circular dependency ist kein Problem, solange es am Ende keinen circular import gibt.

# via ahbicht
more-itertools==10.2.0
# via -r requirements.in
# via
# -r requirements.in
# maus
packaging==24.0
# via marshmallow
pytz==2024.1
# via ahbicht
xmltodict==0.13.0
# via -r requirements.in
9 changes: 8 additions & 1 deletion src/maus/models/anwendungshandbuch.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ class AhbLine:
)
"""a requirement indicator + an optional condition ("ahb expression"), e.g. 'Muss [123] O [456]' """
# note: to parse expressions from AHBs consider using AHBicht: https://github.com/Hochfrequenz/ahbicht/

conditions: Optional[str] = attrs.field(
validator=attrs.validators.optional(validator=attrs.validators.instance_of(str)), default=None
)
"""
The condition text describes the text to the optional condition of the ahb expression.
E.g. '[492] This is a condition text. [999] And this is another one.'
"""
section_name: Optional[str] = attrs.field(
validator=attrs.validators.optional(validator=attrs.validators.instance_of(str)), default=None
)
Expand Down Expand Up @@ -141,6 +147,7 @@ class AhbLineSchema(Schema):
value_pool_entry = fields.String(required=False, load_default=None)
name = fields.String(required=False, load_default=None)
ahb_expression = fields.String(required=False, load_default=None)
conditions = fields.String(required=False, load_default=None)
section_name = fields.String(required=False, load_default=None)
index = fields.Int(required=False, load_default=None, dump_default=None)

Expand Down
Loading