Skip to content

Flip OperatingPoint's alpha default to None and remove its FutureWarning #233

Description

@camUrban

Problem Statement

OperatingPoint.__init__ defaults alpha to 5.0 degrees when the parameter is omitted at a positive vCg__E, and issues a FutureWarning (via the _UNSET sentinel) announcing that the default will change to None in v6.0.0. At a vCg__E of 0.0, an omitted alpha already resolves to NaN without the warning, since that resolution matches the future default. The v6.0.0 release needs to complete the flip.

Location(s): pterasoftware/operating_point.py, tests/unit/test_operating_point.py

Proposed Solution

  1. Change alpha's default from the _UNSET sentinel to None, so an omitted alpha resolves to 0.0 at a positive vCg__E and to NaN at a vCg__E of 0.0, mirroring beta.
  2. Remove the FutureWarning and the sentinel branch for alpha, and update alpha's docstring to describe the None default.
  3. Update test_initialization_with_defaults in tests/unit/test_operating_point.py to stop expecting the FutureWarning and to assert that the default resolves to 0.0.
  4. If the externalFX_W removal (Replace externalFX_W and boundsExternalFX_W with an external_loads interface #230) has also landed, delete the then-unused _Unset class and _UNSET instance; otherwise leave them for that issue.

Additional Context

This is a breaking results change for any caller who omits alpha and relied on the 5.0 degree default, which is why it is scheduled for the v6.0.0 major release and pre-announced with the FutureWarning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceImprovements or additions to documentation, testing, robustness, or tooling

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions