Skip to content

ENH: Use lower case as the only spelling of string options that arch shows - #955

Merged
bashtage merged 7 commits into
mainfrom
a90-lower1-option-case
Oct 17, 2026
Merged

bashtage merged 7 commits into
mainfrom
a90-lower1-option-case

Conversation

@bashtage

Copy link
Copy Markdown
Owner

Branch a90-lower1-option-case, 4 commits on a90-fix-main-tests. Merge #953
first.
This is release decision 64: "Lower case should be the only way the
arch package makes official strings shown to users, even though case
insensitive matching is used."

#947 made every string option case-insensitive, but a few still showed or
stored capitals. They are now lower case everywhere arch shows them:

  • MCS method: the stored MCS.method is now "r"; it was "R". "max"
    is unchanged.
  • arch_model: the mean/vol annotations and defaults are now
    "constant" and "garch"; they were "Constant" and "GARCH".
  • Other options: plot(annualize=...) is now "d", "w", "m"; the
    Phillips-Ouliaris test_type is now "za", "zt", "pu", "pz"; kernel names
    in messages and docs are written like "quadratic-spectral" and
    "newey-west".
  • Where: Literal annotations, signature defaults, docstring option sets,
    error messages, four documentation pages and five example notebooks.

Matching is still case-insensitive: vol="GARCH", method="R" and
annualize="D" work and give identical results. Names that are not option
values are unchanged: model and process names in summaries, class names such as
the KERNELS keys, and test names such as "Phillips-Ouliaris Zt Cointegration
Test".

Behaviour, compared with the base on 1461 cases (every function × option ×
spelling):

  • 1426 are identical.
  • 33 differ only in the text of an error message.
  • 2 differ only in the exposed MCS.method. The MCS p-values and the
    included/excluded sets are identical for "R", "r" and "max".

The golden battery is identical.

Tests: 845 new tests in arch/tests/test_lower_case_options.py (annotations,
defaults, documented sets, listed values, exposed values, and old spellings
still accepted); 14 test files updated for the new values and messages. Fast
suite 24,467 passed. The only failures are the 7 covariance dtype tests that
also fail on main; a separate PR fixes them. Docs build 0 warnings; numpydoc lint
0; style clean. The release notes have a backward-incompatible entry for the
exposed values and messages.

🤖 Generated with Claude Code

…shows

Matching of string options is not case sensitive, but a few options still
had a canonical spelling that was not lower case, and arch showed it in
docstrings, annotations, defaults, error messages and attributes. Lower
case is now the only spelling that arch shows:

- MCS: method is "r" or "max" (the method attribute was "R").
- phillips_ouliaris, phillips_ouliaris_cv and phillips_ouliaris_pval:
  test_type is "za", "zt", "pu" or "pz". The tests keep their names in the
  results ("Phillips-Ouliaris Zt Cointegration Test").
- ARCHModelResult.plot: annualize is "d", "w" or "m".
- arch_model: the annotations, defaults and docstrings use "constant",
  "garch" and the other lower case names.
- Kernels: the error message and the docstrings list the names of the
  classes in KERNELS in lower case with hyphens, such as
  "quadratic-spectral".

Every previous spelling is still accepted and gives the same results. The
tests that checked the old values and messages are updated, and
test_lower_case_options.py checks the annotations, defaults, documented sets,
the values listed in error messages and the exposed values.

xref #947, #950
The narrative documentation and the example notebooks pass the options of
arch_model, plot and phillips_ouliaris and the kernel names in lower case.

xref #947
Comment thread arch/tests/test_lower_case_options.py Fixed
)
self.name = f"Phillips-Ouliaris {test_type} Cointegration Test"
name = _TEST_NAMES.get(test_type.lower(), test_type)
self.name = f"Phillips-Ouliaris {name} Cointegration Test"
@codecov

codecov Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.27273% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.96%. Comparing base (a93ff73) to head (b416698).

Files with missing lines Patch % Lines
arch/tests/test_lower_case_options.py 89.03% 16 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #955      +/-   ##
==========================================
- Coverage   99.01%   98.96%   -0.06%     
==========================================
  Files         134      135       +1     
  Lines       29563    29725     +162     
  Branches     2290     2314      +24     
==========================================
+ Hits        29271    29416     +145     
- Misses        239      255      +16     
- Partials       53       54       +1     
Flag Coverage Δ
adder 98.90% <92.27%> (-0.06%) ⬇️
subtractor 98.90% <92.27%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@bashtage
bashtage merged commit a597ec2 into main Oct 17, 2026
22 of 25 checks passed
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