Skip to content

TST: Follow up #10677 (locale check in the month_plot test) - #10690

Merged
bashtage merged 1 commit into
statsmodels:mainfrom
bashtage:wip-month-plot-locale-followup
Nov 5, 2026
Merged

bashtage merged 1 commit into
statsmodels:mainfrom
bashtage:wip-month-plot-locale-followup

Conversation

@bashtage

@bashtage bashtage commented Nov 5, 2026

Copy link
Copy Markdown
Member

Follow up to #10677. That PR made test_plot_month_locale run under the C locale and under de_DE.UTF-8 and compare the labels of month_plot with strftime("%b"). Its review left one item.

  • tests added / passed.
  • code/documentation is well formatted.
  • properly formatted commit message. See
    NumPy's guide.

Changes

  • TST: month_plot takes the labels from calendar.month_abbr, which is strftime('%b') of the same locale, so the comparison with strftime("%b") cannot differ, and the test also passes when the locale was not applied and the labels stay English. The test now also compares May, October and December literally (May, Oct, Dec under C and Mai, Okt, Dez under German; March stays out because it is "Mär" with glibc and "Mrz" on Windows). The expected list is on one line as ruff format writes it.

Tests

  • To check it I let the German case run with the C locale (replacing calendar.different_locale(locale_name) by calendar.different_locale("C") in a copy). The test of TST: use locale-formatted month_plot expectations #10677 as merged passes, and the test of this PR fails (ACTUAL: 'May', DESIRED: 'Mai').
  • The German labels of this PR are those of glibc (a de_DE.UTF-8 locale compiled with localedef into a scratch directory in WSL: Mär, Mai, Okt, Dez) and of Windows (Python 3.14, Mrz, Mai, Okt, Dez). I did not run macOS; the macOS jobs of Azure run the German case (the step of TST: use locale-formatted month_plot expectations #10677 requires the locale there).
  • test_tsaplots.py: 46 passed with the German locale available. Without it (the WSL default) the German case is xfailed, as on a Linux job without de_DE.UTF-8, and the C case passes.
  • ruff check passes. The file is not ruff format clean elsewhere (the zip of test_plot_quarter); I left that line alone.

AI Disclosure

Contributions must comply with the statsmodels AI Policy.

Tick exactly one of the following. If AI tools were used, replace the <...>
placeholders in the second option with the tool name(s) and how the tool's output was
used.

  • No AI tools were used to develop this pull request.
  • AI tools were used.
    Tool(s): Claude Code (Claude Sonnet 5.5).
    Used for: reviewing TST: use locale-formatted month_plot expectations #10677, and writing the test change.
    I have personally read, understood, and can explain every line of this diff, and
    have verified the statistical/numerical correctness of the change.

🤖 Generated with Claude Code

month_plot and the expected labels of test_plot_month_locale both come from
strftime("%b") of the same locale, so the test also passes when the locale is
not applied and the labels stay English. Compare the three months with the
same name in every variant of the German locale (May, October and December;
March is "Mär" with glibc and "Mrz" on Windows) literally, and write the
expected list on one line as ruff format does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@bashtage
bashtage marked this pull request as ready for review November 5, 2026 15:32
@bashtage
bashtage merged commit c5ec23d into statsmodels:main Nov 5, 2026
13 of 14 checks passed
@bashtage
bashtage deleted the wip-month-plot-locale-followup branch November 20, 2026 10:57
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.

1 participant