Skip to content

Some more fixes for the Python module type hinting.#1415

Merged
bcoconni merged 5 commits intoJSBSim-Team:masterfrom
bcoconni:py_type_hinting
Apr 8, 2026
Merged

Some more fixes for the Python module type hinting.#1415
bcoconni merged 5 commits intoJSBSim-Team:masterfrom
bcoconni:py_type_hinting

Conversation

@bcoconni
Copy link
Copy Markdown
Member

@bcoconni bcoconni commented Apr 3, 2026

Fixes a few errors that were remaining after the PR #1393.

  • The stub file is renamed from _jsbsim.pyi to __init__.pyi so that it applies correctly to the module jsbsim instead of currently jsbsim._jsbsim.
  • Also fixes a pair of type hintings where the transition from SGPropertyNode to FGPropertyNode (see PR Remove the class FGPropertyNode #1270) has been overlooked.
  • Remove the useless statement from . import _jsbsim.

EDIT: see also #1415 (comment)

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.11%. Comparing base (1b9c981) to head (181950f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1415   +/-   ##
=======================================
  Coverage   25.11%   25.11%           
=======================================
  Files         169      169           
  Lines       18720    18720           
=======================================
  Hits         4702     4702           
  Misses      14018    14018           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agodemar
Copy link
Copy Markdown
Contributor

agodemar commented Apr 3, 2026

OK to merge!

@bcoconni
Copy link
Copy Markdown
Member Author

bcoconni commented Apr 8, 2026

I have updated the PR with the following:

  • Added the class DefaultLogger and the function set_logger to __init__.py
  • Functions and methods with a name starting by a single underscore are excluded from the module type hinting.
  • The function inherit_docstring has been renamed _inherit_docstring_from_super_class for clarity and to be excluded from the module type hinting since it is for internal use only.
  • Added some documentation to the C++ class FGLogger and the functions SetLogger and GetLogger.

@agodemar, @seanmcleod70 let me know if that is still OK with you to merge.

@agodemar
Copy link
Copy Markdown
Contributor

agodemar commented Apr 8, 2026

@bcoconni green light from my side

@seanmcleod70
Copy link
Copy Markdown
Contributor

Looks good to me.

@bcoconni bcoconni merged commit 0487004 into JSBSim-Team:master Apr 8, 2026
30 checks passed
@bcoconni bcoconni deleted the py_type_hinting branch April 8, 2026 15:10
@bcoconni
Copy link
Copy Markdown
Member Author

bcoconni commented Apr 8, 2026

Thanks. The PR is merged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants