Skip to content

Commit

Permalink
Fix beslisboom integratie (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
berrydenhartog authored Dec 10, 2024
2 parents 02fc060 + 7a8aa5c commit 2684ac2
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 22 deletions.
4 changes: 2 additions & 2 deletions amt/api/ai_act_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def get_ai_act_profile_selector(request: Request) -> AiActProfileSelector:

systemic_risk_options = ("systeemrisico", "geen systeemrisico", "niet van toepassing")
transparency_obligations_options = (
"transparantieverplichtingen",
"geen transparantieverplichtingen",
"transparantieverplichting",
"geen transparantieverplichting",
"niet van toepassing",
)
open_source_options = ("open-source", "geen open-source", "niet van toepassing")
Expand Down
Binary file modified amt/locale/en_US/LC_MESSAGES/messages.mo
Binary file not shown.
Binary file modified amt/locale/nl_NL/LC_MESSAGES/messages.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions amt/locale/nl_NL/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ msgstr ""

#: amt/api/ai_act_profile.py:32
msgid "Is there a systemic risk?"
msgstr "Is er sprake van systematisch risico?"
msgstr "Is er sprake van een systeemrisico?"

#: amt/api/ai_act_profile.py:34
msgid "Is there a transparency obligation?"
Expand Down Expand Up @@ -570,7 +570,7 @@ msgstr "Vind uw AI Act profiel"

#: amt/site/templates/algorithms/new.html.j2:112
msgid "Select Option"
msgstr "Selecteer organisatie"
msgstr "Selecteer optie"

#: amt/site/templates/algorithms/new.html.j2:172
msgid ""
Expand Down
1 change: 1 addition & 0 deletions amt/site/static/ts/amt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export function closeModalSave(id: string) {
aiActProfileRaw["Rol"],
aiActProfileRaw["Open source"],
);

// Select the correct entries.
Object.entries(aiActProfile).forEach(([category, el_ids]) => {
el_ids.forEach((el_id: string) => {
Expand Down
2 changes: 1 addition & 1 deletion resources/system_card_templates/AMT_Template_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"risk_group": "hoog-risico AI",
"conformity_assessment_body": "niet van toepassing",
"systemic_risk": "geen systeemrisico",
"transparency_obligations": "geen transparantieverplichtingen",
"transparency_obligations": "geen transparantieverplichting",
"role": "gebruiksverantwoordelijke"
},
"instruments": [
Expand Down
4 changes: 2 additions & 2 deletions tests/api/routes/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ async def test_post_new_algorithms(client: AsyncClient, mocker: MockFixture, db:
risk_group="hoog-risico AI",
conformity_assessment_body="beoordeling door derde partij",
systemic_risk="geen systeemrisico",
transparency_obligations="geen transparantieverplichtingen",
transparency_obligations="geen transparantieverplichting",
role="gebruiksverantwoordelijke",
template_id="0",
organization_id=1,
Expand Down Expand Up @@ -179,7 +179,7 @@ async def test_post_new_algorithms_write_system_card(
risk_group="hoog-risico AI",
conformity_assessment_body="beoordeling door derde partij",
systemic_risk="geen systeemrisico",
transparency_obligations="geen transparantieverplichtingen",
transparency_obligations="geen transparantieverplichting",
role="gebruiksverantwoordelijke",
template_id="",
organization_id=1,
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/test_create_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_e2e_create_algorithm(page: Page) -> None:
page.locator("#role-aanbieder").check()
page.locator("#type").select_option("AI-systeem voor algemene doeleinden")
page.locator("#risk_group").select_option("verboden AI")
page.locator("#transparency_obligations").select_option("geen transparantieverplichtingen")
page.locator("#transparency_obligations").select_option("geen transparantieverplichting")
page.locator("#systemic_risk").select_option("geen systeemrisico")
page.locator("#open_source").select_option("geen open-source")
page.locator("#conformity_assessment_body").select_option("niet van toepassing")
Expand All @@ -45,7 +45,7 @@ def test_e2e_create_algorithm_invalid(page: Page):

page.goto("/algorithms/new")

page.locator("#transparency_obligations").select_option("geen transparantieverplichtingen")
page.locator("#transparency_obligations").select_option("geen transparantieverplichting")

page.locator("#open_source").select_option("geen open-source")

Expand Down
18 changes: 9 additions & 9 deletions tests/schema/test_schema_ai_act_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ def test_ai_act_profile_schema_create_new():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role="aanbieder",
)
assert algorithm_new.type == "AI-systeem"
assert algorithm_new.open_source == "open-source"
assert algorithm_new.risk_group == "hoog-risico AI"
assert algorithm_new.systemic_risk == "systeemrisico"
assert algorithm_new.transparency_obligations == "transparantieverplichtingen"
assert algorithm_new.transparency_obligations == "transparantieverplichting"
assert algorithm_new.role == "aanbieder"


Expand All @@ -25,14 +25,14 @@ def test_ai_act_profile_schema_create_new_no_role():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role=None,
)
assert algorithm_new.type == "AI-systeem"
assert algorithm_new.open_source == "open-source"
assert algorithm_new.risk_group == "hoog-risico AI"
assert algorithm_new.systemic_risk == "systeemrisico"
assert algorithm_new.transparency_obligations == "transparantieverplichtingen"
assert algorithm_new.transparency_obligations == "transparantieverplichting"
assert algorithm_new.role is None


Expand All @@ -42,14 +42,14 @@ def test_ai_act_profile_schema_create_new_empty_role_list():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role=[],
)
assert algorithm_new.type == "AI-systeem"
assert algorithm_new.open_source == "open-source"
assert algorithm_new.risk_group == "hoog-risico AI"
assert algorithm_new.systemic_risk == "systeemrisico"
assert algorithm_new.transparency_obligations == "transparantieverplichtingen"
assert algorithm_new.transparency_obligations == "transparantieverplichting"
assert algorithm_new.role is None


Expand All @@ -59,14 +59,14 @@ def test_ai_act_profile_schema_create_new_double_role():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role=["aanbieder", "gebruiksverantwoordelijke"],
)
assert algorithm_new.type == "AI-systeem"
assert algorithm_new.open_source == "open-source"
assert algorithm_new.risk_group == "hoog-risico AI"
assert algorithm_new.systemic_risk == "systeemrisico"
assert algorithm_new.transparency_obligations == "transparantieverplichtingen"
assert algorithm_new.transparency_obligations == "transparantieverplichting"
assert algorithm_new.role == "aanbieder + gebruiksverantwoordelijke"


Expand All @@ -77,6 +77,6 @@ def test_ai_act_profile_schema_create_new_too_many_roles():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role=["aanbieder", "gebruiksverantwoordelijke", "I am too much of a role"],
)
8 changes: 4 additions & 4 deletions tests/schema/test_schema_algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_algorithm_schema_create_new():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role=["aanbieder", "gebruiksverantwoordelijke"],
organization_id=1,
)
Expand All @@ -20,7 +20,7 @@ def test_algorithm_schema_create_new():
assert algorithm_new.open_source == "open-source"
assert algorithm_new.risk_group == "hoog-risico AI"
assert algorithm_new.systemic_risk == "systeemrisico"
assert algorithm_new.transparency_obligations == "transparantieverplichtingen"
assert algorithm_new.transparency_obligations == "transparantieverplichting"
assert algorithm_new.role == ["aanbieder", "gebruiksverantwoordelijke"]
assert algorithm_new.organization_id == 1

Expand All @@ -34,7 +34,7 @@ def test_algorithm_schema_create_new_one_instrument():
open_source="open-source",
risk_group="hoog-risico AI",
systemic_risk="systeemrisico",
transparency_obligations="transparantieverplichtingen",
transparency_obligations="transparantieverplichting",
role="aanbieder",
organization_id=1,
)
Expand All @@ -44,6 +44,6 @@ def test_algorithm_schema_create_new_one_instrument():
assert algorithm_new.open_source == "open-source"
assert algorithm_new.risk_group == "hoog-risico AI"
assert algorithm_new.systemic_risk == "systeemrisico"
assert algorithm_new.transparency_obligations == "transparantieverplichtingen"
assert algorithm_new.transparency_obligations == "transparantieverplichting"
assert algorithm_new.role == ["aanbieder"]
assert algorithm_new.organization_id == 1

0 comments on commit 2684ac2

Please sign in to comment.