Description
When calling TCL.constantSpeedLevel with stepClimb=True, an exception is raised:
Exception: Undefined Heading value combination
After inspecting the source code, the issue appears to be caused by both HDGMagnetic[-1] and HDGTrue[-1] being non-None when passed into constantSpeedRating.
In constantSpeedLevel, the following branch is taken when Lat, Lon, and magneticHeading evaluate to True:
initialHeading={
"magnetic": HDGMagnetic[-1],
"true": HDGTrue[-1],
"constantHeading": constantHeading,
}
However, inside constantSpeedRating, the heading validation logic only allows exactly one of trueHeading or magneticHeading to be defined:
if trueHeading is not None and magneticHeading is None:
...
elif magneticHeading is not None and trueHeading is None:
...
else:
raise Exception("Undefined Heading value combination")
As a result, providing both values triggers the exception.
Questions for maintainers
Should constantSpeedLevel ensure that only one of HDGTrue or HDGMagnetic is passed to constantSpeedRating?
Or is constantSpeedRating expected to handle the case where both are provided ?
What is the intended heading-handling logic when stepClimb=True?
I would appreciate guidance on the correct behavior or a recommended fix.
Description
When calling
TCL.constantSpeedLevelwithstepClimb=True, an exception is raised:After inspecting the source code, the issue appears to be caused by both
HDGMagnetic[-1]andHDGTrue[-1]being non-Nonewhen passed intoconstantSpeedRating.In
constantSpeedLevel, the following branch is taken whenLat,Lon, andmagneticHeadingevaluate toTrue:However, inside
constantSpeedRating, the heading validation logic only allows exactly one oftrueHeadingormagneticHeadingto be defined:As a result, providing both values triggers the exception.
Questions for maintainers
Should
constantSpeedLevelensure that only one ofHDGTrueorHDGMagneticis passed toconstantSpeedRating?Or is
constantSpeedRatingexpected to handle the case where both are provided ?What is the intended heading-handling logic when
stepClimb=True?I would appreciate guidance on the correct behavior or a recommended fix.