Skip to content

Commit

Permalink
Merge pull request #706 from bashtage/add-pre-release-testing
Browse files Browse the repository at this point in the history
CI: Add pre-release testing
  • Loading branch information
bashtage authored Jan 4, 2024
2 parents 7c4fc34 + bcc4c08 commit 0e74343
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 6 deletions.
1 change: 1 addition & 0 deletions arch/bootstrap/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Tools for implementing statistical bootstraps
"""

from arch.bootstrap import _samplers_python
from arch.bootstrap.base import (
CircularBlockBootstrap,
Expand Down
1 change: 1 addition & 0 deletions arch/covariance/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class CovarianceEstimator(ABC):
where :math:`z=\frac{h}{H}, h=0, 1, \ldots, H` where H is the bandwidth.
"""

_name = ""

def __init__(
Expand Down
1 change: 1 addition & 0 deletions arch/unitroot/critical_values/dfgls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
These have been computed using the methodology of MacKinnon (1994) and (2010)
simulation. See dfgls_critival_values_simulation for implementation.
"""

from __future__ import annotations

from numpy import array
Expand Down
1 change: 1 addition & 0 deletions arch/unitroot/critical_values/dickey_fuller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
did not appear in the original paper and have been computed using an identical
simulation.
"""

from __future__ import annotations

from numpy import array, asarray, inf
Expand Down
1 change: 1 addition & 0 deletions arch/unitroot/critical_values/phillips_ouliaris.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
P-type statistics with trend ct based on 11,250,000 simulations
P-type statistics with trend ctt based on 13,250,000 simulations
"""

from __future__ import annotations

from math import inf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Remote clusters can be used by modifying the call to Client.
"""

import datetime
from typing import Literal, cast

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Simulation of ADF z-test critical values. Closely follows MacKinnon (2010).
"""

from __future__ import annotations

import argparse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
This version has been optimized for execution on a large cluster and should
scale well with 128 or more engines.
"""

from __future__ import annotations

import datetime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
to MacKinnon (2010). Makes use of parallel_fun in statsmodels which works
best when joblib is installed.
"""

from __future__ import annotations

import datetime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Simulation for critical value production for Engle-Granger
"""

import argparse
import datetime as dt
from functools import partial
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Calculates quantiles of the KPSS test statistic for both the constant
and constant plus trend scenarios.
"""

import os
from typing import Optional, cast

Expand Down
1 change: 1 addition & 0 deletions arch/unitroot/critical_values/zivot_andrews.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
The p-values are generated through Monte Carlo simulation using 100,000
replications and 2000 data points.
"""

from __future__ import annotations

from numpy import array
Expand Down
1 change: 1 addition & 0 deletions arch/univariate/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Core classes for ARCH models
"""

from __future__ import annotations

from abc import ABCMeta, abstractmethod
Expand Down
3 changes: 3 additions & 0 deletions arch/univariate/mean.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Mean models to use with ARCH processes. All mean models must inherit from
:class:`ARCHModel` and provide the same methods with the same inputs.
"""

from __future__ import annotations

from collections.abc import Mapping, Sequence
Expand Down Expand Up @@ -240,6 +241,7 @@ class HARX(ARCHModel, metaclass=AbstractDocStringInheritor):
where :math:`\bar{y}_{t-L_{i,0}:L_{i,1}}` is the average value of
:math:`y_t` between :math:`t-L_{i,0}` and :math:`t - L_{i,1}`.
"""

# To allow for addition mean parameters in simulation
_extra_simulation_params: int = 0

Expand Down Expand Up @@ -1624,6 +1626,7 @@ class ARCHInMean(ARX):
where :math:`f(\cdot)` is the function specified by ``form``.
"""

# To account for GIM param
_extra_simulation_params = 1

Expand Down
1 change: 1 addition & 0 deletions arch/univariate/recursions_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
export ARCH_NO_BINARY=1
python -m pip install .
"""

from __future__ import annotations

from arch.compat.numba import jit
Expand Down
1 change: 1 addition & 0 deletions arch/univariate/volatility.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
inherit from :class:`VolatilityProcess` and provide the same methods with the
same inputs.
"""

from __future__ import annotations

from abc import ABCMeta, abstractmethod
Expand Down
3 changes: 2 additions & 1 deletion arch/utility/array.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Utility functions that do not explicitly relate to Volatility modeling
"""

from __future__ import annotations

from arch.compat.pandas import is_datetime64_any_dtype
Expand Down Expand Up @@ -86,7 +87,7 @@ def ensure1d(


def ensure2d(
x: (Sequence[float | int] | Sequence[Sequence[float | int]] | ArrayLike),
x: Sequence[float | int] | Sequence[Sequence[float | int]] | ArrayLike,
name: str,
) -> DataFrame | NDArray:
if isinstance(x, Series):
Expand Down
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ variables:
MPLBACKEND: agg
PYTEST_PATTERN: "(not slow)"
coverage: true
test.install: false
pip.pre: false

jobs:
- template: ci/azure/azure_template_posix.yml
Expand Down
13 changes: 12 additions & 1 deletion ci/azure/azure_template_posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ jobs:
SCIPY: 1.5.0
MATPLOTLIB: 3.3.0
PANDAS: 1.1.0
python312_pre:
python.version: '3.12'
pip.pre: true

maxParallel: 10

Expand Down Expand Up @@ -157,7 +160,15 @@ jobs:
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
displayName: 'Run tests (editable)'
condition: ne(variables['test.install'], 'true')
condition: and(ne(variables['test.install'], 'true'), ne(variables['pip.pre'], 'true'))
- script: |
echo "Testing pip-pre"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${PYTEST_OPTS} arch/tests
displayName: 'Run tests (pip pre)'
condition: eq(variables['pip.pre'], 'true')
continueOnError: true
- task: PublishTestResults@2
inputs:
Expand Down
9 changes: 8 additions & 1 deletion ci/azure/install-posix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
fi

python -m pip install --upgrade pip "setuptools>=61" wheel
python -m pip install cython "pytest>=7,<7.1" pytest-xdist coverage pytest-cov ipython jupyter notebook nbconvert "property_cached>=1.6.3" black isort flake8 nbconvert setuptools_scm
python -m pip install cython "pytest>=7" pytest-xdist coverage pytest-cov ipython jupyter notebook nbconvert "property_cached>=1.6.3" black isort flake8 nbconvert setuptools_scm colorama

if [[ -n ${NUMPY} ]]; then CMD="$CMD~=${NUMPY}"; fi;
CMD="$CMD scipy"
Expand All @@ -35,3 +35,10 @@ fi;
CMD="$CMD $EXTRA"
echo $CMD
eval $CMD

if [ "${PIP_PRE}" = true ]; then
python -m pip install matplotlib cython --upgrade
python -m pip uninstall -y numpy pandas scipy matplotlib statsmodels
python -m pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy pandas scipy matplotlib --upgrade --use-deprecated=legacy-resolver
python -m pip install git+https://github.com/statsmodels/statsmodels.git --upgrade --no-build-isolation -v
fi
6 changes: 6 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=arch
set SPHINXOPTS=
set PYDEVD_DISABLE_FILE_VALIDATION=1

if "%1" == "" goto help

Expand All @@ -22,14 +25,17 @@ if errorlevel 9009 (
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://sphinx-doc.org/
set PYDEVD_DISABLE_FILE_VALIDATION=
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
set PYDEVD_DISABLE_FILE_VALIDATION=
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
set PYDEVD_DISABLE_FILE_VALIDATION=

:end
popd
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setuptools>=61
wheel
setuptools_scm[toml]>=7,<8
setuptools_scm[toml]>=8.0.3,<9
oldest-supported-numpy
cython>=0.29.34 # Works with 3.0.0b2
numpy >=1.22
Expand Down
7 changes: 6 additions & 1 deletion doc/source/changes/6.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
Version 6
=========

Release 6.3
===========
- Compatability with NumPy 2
- Fixes for future changes in pandas

Release 6.2
===========
- Fixed a bug that affected forecasting from :class:`~arch.univariate.volatility.FIGARCH` models (:issue:`606`).
- Added a performance warning when testing for unit roots in large series using a lag-length
search with no-max-lag specified.
- Fixed a bug that affected forecasting from :class:`arch.univariate.volatility.FIGARCH'
- Fixed a bug that affected forecasting from :class:`arch.univariate.volatility.FIGARCH`
models (:issue:`606`).
- Changed the default value of ``reindex`` to ``False`` so that forecasts
will not match the input by default. Set ``reindex`` to ``True`` if this is
Expand Down
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ pytest-xdist
pytest-cov

# formatting
black[jupyter]==23.9.1
black[jupyter]==23.12.1
isort~=5.0
colorama
flake8
mypy
pyupgrade>=3.4.0
Expand Down

0 comments on commit 0e74343

Please sign in to comment.