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

[uss_qualifier/scenarios/netrid/common_dictionary_evaluator] Simplify check for UA type #895

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -783,21 +783,14 @@ def _evaluate_ua_type(
) as check:
equivalent = {injection.UAType.HybridLift, injection.UAType.VTOL}

if injected_val is None:
if (
sp_observed_flight is not None
and observed_val != injection.UAType.NotDeclared
): # C6
check.record_failed(
"UA type is inconsistent, expected 'NotDeclared' since no value was injected",
details=f"SP returned the UA type {observed_val}, yet no value was injected, which should have been mapped to 'NotDeclared'.",
query_timestamps=[query_timestamp],
)
if dp_observed_flight is not None and observed_val is None:
pass # C8
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this C8 comment ? A more explicit reference seems to be required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the Cn comments refer to the cases listed in common_dictionary_evaluator.md.
The function documentation already mentions:

        Evaluates UA type. Exactly one of sp_observed_flight or dp_observed_flight must be provided.
        See as well `common_dictionary_evaluator.md`.

And the function implementation has such comments all throughout referring to the different cases.
Is it OK as is or would you add something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I will go ahead and merge this PR to unblock #894 and other upcoming changes. I will make a follow-up PR if you'd like an additional change regarding this @barroco.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think mentioning in the comment of the function the explicit location of the cases description would be a good improvement when you have the opportunity.


if dp_observed_flight is not None and observed_val is not None: # C10
elif injected_val is None:
if observed_val != injection.UAType.NotDeclared: # C6 / C10
check.record_failed(
"UA type is inconsistent, expected no value since none was injected",
details=f"DP returned the UA type {observed_val}, yet no value was injected.",
"UA type is inconsistent, expected 'NotDeclared' since no value was injected",
details=f"USS returned the UA type {observed_val} yet no value was injected. Since 'aircraft_type' is a required field of SP API, the SP should map this to 'NotDeclared' and the DP should expose the same value.",
query_timestamps=[query_timestamp],
)

Expand Down
Loading