@@ -279,8 +279,8 @@ def _qualifiers(value: str, units: Units) -> Qualifiers:
279279 fir , q_code , * codes = (i .strip () for i in re .split ("/| " , value .strip ()))
280280 traffic , purpose , scope , lower , upper , location = _find_q_codes (codes )
281281 subject , condition = None , None
282- if q_code .startswith ("Q" ):
283- subject = Code .from_dict (q_code [1 :3 ], SUBJECT )
282+ if q_code .startswith ("Q" ) and len ( q_code ) >= 5 :
283+ subject = Code ( q_code [ 1 : 3 ], "Other" ) if q_code [ 1 ] == "Q" else Code .from_dict (q_code [1 :3 ], SUBJECT )
284284 condition_code = q_code [3 :]
285285 if condition_code .startswith ("XX" ):
286286 condition = Code ("XX" , (condition_code [2 :] or "Unknown" ).strip ())
@@ -345,7 +345,9 @@ def make_altitude(value: str | None, units: Units) -> Number | None:
345345 """Parse NOTAM altitudes."""
346346 if not value :
347347 return None
348- if trimmed := value .split ()[0 ].strip (" ." ): # noqa: SIM102
348+ if trimmed := value .split ()[0 ].strip (" ." ):
349+ if "(" in trimmed :
350+ trimmed = trimmed [trimmed .find ("(" ) + 1 :]
349351 if trimmed in SPECIAL_NUMBERS or trimmed [0 ].isdigit ():
350352 return core .make_altitude (trimmed , units , repr = value )[0 ]
351353 return None
0 commit comments