Skip to content

Expose the public API at the package top level #241

Description

@camUrban

Problem Statement

The recommended spellings for building a simulation are long and repeat themselves, because every public class name already encodes its module name: ps.geometry.airplane.Airplane says "airplane" twice, and ps.steady_horseshoe_vortex_lattice_method.SteadyHorseshoeVortexLatticeMethodSolver spells the same name once in snake_case and once in CamelCase. The module path adds no disambiguation, since every public class name in the package is globally unique and self-describing. The package also already has a flat tier: load, save, and set_up_logging are exposed at the top level through the lazy-import tables in pterasoftware/__init__.py.

Location(s): pterasoftware/__init__.py, the example scripts in examples/, README.md

Proposed Solution

  1. Add every public class and function to the lazy-import tables in pterasoftware/__init__.py so they are importable directly from the package (ps.Airplane, ps.WingCrossSection, ps.SteadyHorseshoeVortexLatticeMethodSolver, and so on), keeping the imports deferred so the package's import time does not grow.
  2. Keep the module-path spellings public and working. This change is purely additive, so nothing breaks and no deprecation warnings are needed.
  3. Update the example scripts, README.md, and the documentation website to use the flat spellings as the recommended form.

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

    featureNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions