Skip to content

TST: Improve thread safety of tests - #9910

Merged
bashtage merged 7 commits into
statsmodels:mainfrom
bashtage:improve-thread-safety-v2
Jul 15, 2026
Merged

TST: Improve thread safety of tests#9910
bashtage merged 7 commits into
statsmodels:mainfrom
bashtage:improve-thread-safety-v2

Conversation

@bashtage

Copy link
Copy Markdown
Member
  • closes #xxxx
  • tests added / passed.
  • code/documentation is well formatted.
  • properly formatted commit message. See
    NumPy's guide.
Details

Notes:

  • It is essential that you add a test when making code changes. Tests are not
    needed for doc changes.
  • When adding a new function, test values should usually be verified in another package (e.g., R/SAS/Stata).
  • When fixing a bug, you must add a test that would produce the bug in main and
    then show that it is fixed with the new code.
  • New code additions must be well formatted. Changes should pass flake8. If on Linux or OSX, you can
    verify you changes are well formatted by running
    git diff upstream/main -u -- "*.py" | flake8 --diff --isolated
    
    assuming flake8 is installed. This command is also available on Windows
    using the Windows System for Linux once flake8 is installed in the
    local Linux environment. While passing this test is not required, it is good practice and it help
    improve code quality in statsmodels.
  • Docstring additions must render correctly, including escapes and LaTeX.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
results = model.fit(results.params, method="nm", maxiter=1000, disp=False)
if not results.llf > results.llf:
assert_allclose(results.llf, results.llf, rtol=1e-5)

name = self.model.endog_names[i]
name = model.endog_names[i]
assert re.search("Results for factor equation f%d" % (i + 1), table)

Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
except ImportError:
pass
register_matplotlib_converters()
except ImportError:
@bashtage

bashtage commented Jul 15, 2026

Copy link
Copy Markdown
Member Author
  • FAILED statsmodels/regression/tests/test_rolling.py::test_has_nan[250-3-True-True-0.1]
  • FAILED statsmodels/emplike/tests/test_anova.py::TestANOVA::test_anova - AssertionError:
  • FAILED statsmodels/regression/tests/test_recursive_ls.py::test_plots - ValueError:
  • FAILED statsmodels/tsa/statespace/tests/test_models.py::TestIntercepts::test_smoothed_forecasts - AssertionError:
  • FAILED statsmodels/emplike/tests/test_aft.py::Test_AFTModel::test_beta1 - AssertionError:
  • FAILED statsmodels/tools/tests/test_grouputils.py::TestMultiIndexGrouping::test_dummy_sparse - AssertionError:
  • FAILED statsmodels/emplike/tests/test_aft.py::Test_AFTModel::test_beta0 - AssertionError:
  • FAILED statsmodels/discrete/tests/test_count_model.py::TestZeroInflatedGeneralizedPoisson_predict::test_predict_prob - AttributeError: 'GeneralizedPoisson' object has no attribute 'offset'

self.nobs = self.nobs + len(i)

def compute_ANOVA(self, mu=None, mu_start=0, return_weights=0):
def compute_ANOVA(self, mu=None, mu_start=0, return_weights=False):
@bashtage bashtage changed the title TST: Improve thread saftey of tests TST: Improve thread safety of tests Jul 15, 2026
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
Comment thread statsmodels/tsa/statespace/tests/test_dynamic_factor.py Fixed
@bashtage
bashtage merged commit ed88320 into statsmodels:main Jul 15, 2026
7 of 8 checks passed
@bashtage
bashtage deleted the improve-thread-safety-v2 branch July 20, 2026 17:17
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.

2 participants