Skip to content

Fix the failure of TestActuator.py due to some deprecations in SciPy#1376

Merged
bcoconni merged 2 commits intoJSBSim-Team:masterfrom
bcoconni:bcoconni/issue1374
Jan 16, 2026
Merged

Fix the failure of TestActuator.py due to some deprecations in SciPy#1376
bcoconni merged 2 commits intoJSBSim-Team:masterfrom
bcoconni:bcoconni/issue1374

Conversation

@bcoconni
Copy link
Member

This PR is meant to fix the bug reported in issue #1374:

  • No longer use stats.linregress in a way that is deprecated since SciPy 1.16
  • Take this opportunity to get the linear regression result using the LinregressResult class rather than using the named tuple which has been kept for backward compatibility and is susceptible to be deprecated at some point.

Copilot AI review requested due to automatic review settings January 16, 2026 11:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses deprecation warnings from SciPy 1.16 by updating the usage of stats.linregress in the test suite. The changes ensure compatibility with newer versions of SciPy while maintaining the same test functionality.

Changes:

  • Updated stats.linregress call to use separate x and y arrays instead of a 2D array
  • Switched from unpacking the result tuple to using the LinregressResult object's attributes (.slope and .rvalue)
  • Added NumPy import to facilitate the array conversion

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.24%. Comparing base (9ea4925) to head (be63ccb).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1376   +/-   ##
=======================================
  Coverage   25.24%   25.24%           
=======================================
  Files         169      169           
  Lines       18549    18549           
=======================================
  Hits         4682     4682           
  Misses      13867    13867           

☔ 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.

@seanmcleod70
Copy link
Contributor

Looks good, plus all the tests passed 😉

@bcoconni
Copy link
Member Author

Since the LinregressResult class has been introduced in SciPy 1.7.0 (see the SciPy docs), I have updated the requirements.txt file accordingly.

@bcoconni bcoconni merged commit 5988bb4 into JSBSim-Team:master Jan 16, 2026
28 checks passed
@bcoconni bcoconni deleted the bcoconni/issue1374 branch January 16, 2026 12:56
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