Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions .coveragerc

This file was deleted.

42 changes: 20 additions & 22 deletions ci/azure_template_posix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
PANDAS: 1.3.0
STATSMODELS: 0.13.1
XARRAY: 0.21.0
FORMULAIC: 1.0.2
FORMULAIC: 1.2.1
test.wheel: true
python310_mid_sdist:
python.version: '3.10'
Expand All @@ -33,7 +33,7 @@ jobs:
STATSMODELS: 0.13.1
XARRAY: 2022.6.0
XXHASH: true
FORMULAIC: 1.0.2
FORMULAIC: 1.2.1
test.sdist: true
python310_recent_wheel:
python.version: '3.10'
Expand All @@ -42,16 +42,13 @@ jobs:
PANDAS: 2.0.0
STATSMODELS: 0.14.0
XARRAY: 2023.4.0
FORMULAIC: 1.1.0
FORMULAIC: 1.2.1
test.wheel: true
python310_latest:
python.version: '3.10'
FORMULAIC: 1.2.0
FORMULAIC: 1.2.1
XXHASH: true
PYARROW: true
python310_no_cython:
python.version: '3.10'
BUILD_FLAGS: '-Csetup-args=-Dno-binary=true'
python311_latest:
python.version: '3.11'
XXHASH: true
Expand All @@ -60,6 +57,11 @@ jobs:
python.version: '3.12'
XXHASH: true
PYARROW: true
python312_latest_no_binary:
python.version: '3.12'
XXHASH: true
PYARROW: true
BUILD_FLAGS: '-Csetup-args=-Dno-binary=true'
python313_latest:
python.version: '3.13'
XXHASH: true
Expand All @@ -69,8 +71,8 @@ jobs:
python.version: '3.12'
XXHASH: true
LM_TEST_COPY_ON_WRITE: 1
python312_pre:
python.version: '3.12'
python313_pre:
python.version: '3.13'
pip.pre: true
maxParallel: 10

Expand Down Expand Up @@ -119,8 +121,8 @@ jobs:
condition: eq(variables['test.wheel'], 'true')

- script: |
echo python -m pip install --no-build-isolation -vv -e . ${FLAGS}
python -m pip install --no-build-isolation -vv -e . ${FLAGS}
echo python -m pip install --no-build-isolation -vv -e . ${BUILD_FLAGS}
python -m pip install --no-build-isolation -vv -e . ${BUILD_FLAGS}
displayName: 'Install linearmodels (editable)'
condition: and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true'))

Expand All @@ -135,21 +137,17 @@ jobs:

- script: |
echo "Testing editable install"
if [[ ${COVERAGE} == "true" ]]; then
export COVERAGE_OPTS="--cov=linearmodels --cov-report xml:coverage.xml --cov-report term"
fi
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
export COVERAGE_OPTS="--cov=linearmodels --cov-report xml:coverage.xml --cov-report term"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${BUILD_FLAGS} linearmodels/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
displayName: 'Run tests (editable)'
condition: and(and(ne(variables['test.wheel'], 'true'), ne(variables['test.sdist'], 'true')), ne(variables['pip.pre'], 'true'))

- script: |
echo "Testing pip-pre"
if [[ ${COVERAGE} == "true" ]]; then
export COVERAGE_OPTS="--cov-config .coveragerc --cov=linearmodels --cov-report xml:coverage.xml --cov-report term"
fi
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
export COVERAGE_OPTS="--cov=linearmodels --cov-report xml:coverage.xml --cov-report term"
echo pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} ${BUILD_FLAGS} linearmodels/tests
pytest -m "${PYTEST_PATTERN}" --junitxml=junit/test-results.xml -n auto --durations=25 ${COVERAGE_OPTS} linearmodels/tests
displayName: 'Run tests (pip pre)'
condition: eq(variables['pip.pre'], 'true')
continueOnError: true
Expand All @@ -163,11 +161,11 @@ jobs:
- task: PublishCodeCoverageResults@2
inputs:
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
condition: and(eq(variables['coverage'], 'true'), ne(variables['test.install'], 'true'))
condition: and(ne(variables['test.sdist'], 'true'), ne(variables['test.wheel'], 'true'))

- script: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -f coverage.xml -F adder -F subtractor
displayName: 'Codecov upload'
condition: and(eq(variables['coverage'], 'true'), ne(variables['test.install'], 'true'))
condition: and(ne(variables['test.sdist'], 'true'), ne(variables['test.wheel'], 'true'))
1 change: 0 additions & 1 deletion linearmodels/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ inc_np = include_directories(incdir_numpy, is_system: true)
# Copy the main __init__.py to the build dir.
# Some submodules (linalg, special, optimize) add pxd files to this.
# Needed to trick Cython, it won't do a relative import outside a package
_cython_tree = [fs.copyfile('__init__.py')]
cython_args = [
'-Xcpow=True',
'-Xboundscheck=False',
Expand Down
18 changes: 9 additions & 9 deletions linearmodels/tests/panel/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ def test_general_demean_oneway(mi_df):
dm1 = y.demean("time")
g = DataFrame(y.time_ids, index=y.index)
dm2 = y.general_demean(g)
assert_allclose(dm1.values2d, dm2.values2d)
assert_allclose(dm1.values2d, dm2.values2d, atol=1e-10)

g = DataFrame(np.random.randint(0, 10, g.shape), index=y.index)
dm2 = y.general_demean(g)
Expand All @@ -672,7 +672,7 @@ def test_general_demean_twoway(mi_df):
g = DataFrame(y.entity_ids, index=y.index)
g["column2"] = Series(y.time_ids.squeeze(), index=y.index)
dm2 = y.general_demean(g)
assert_allclose(dm1.values2d, dm2.values2d)
assert_allclose(dm1.values2d, dm2.values2d, atol=1e-10)

g = DataFrame(np.random.randint(0, 10, g.shape), index=y.index)
dm2 = y.general_demean(g)
Expand All @@ -692,24 +692,24 @@ def test_general_unit_weighted_demean_oneway(mi_df):
weights = PanelData(g).copy()
weights.dataframe.iloc[:, :] = 1
dm2 = y.general_demean(g, weights)
assert_allclose(dm1.values2d, dm2.values2d)
assert_allclose(dm1.values2d, dm2.values2d, atol=1e-10)
dm3 = y.general_demean(g)
assert_allclose(dm3.values2d, dm2.values2d)
assert_allclose(dm3.values2d, dm2.values2d, atol=1e-10)

dm1 = y.demean("time")
g = PanelData(DataFrame(y.time_ids, index=y.index))
dm2 = y.general_demean(g, weights)
assert_allclose(dm1.values2d, dm2.values2d)
assert_allclose(dm1.values2d, dm2.values2d, atol=1e-10)
dm3 = y.general_demean(g)
assert_allclose(dm3.values2d, dm2.values2d)
assert_allclose(dm3.values2d, dm2.values2d, atol=1e-10)

g = PanelData(DataFrame(np.random.randint(0, 10, g.dataframe.shape), index=y.index))
dm2 = y.general_demean(g, weights)
dm3 = y.general_demean(g)
g = Categorical(g.dataframe.iloc[:, 0])
d = get_dummies(g)
dm1 = y.values2d - d @ lstsq(d, y.values2d, rcond=None)[0]
assert_allclose(dm1, dm2.values2d)
assert_allclose(dm1, dm2.values2d, atol=1e-10)
assert_allclose(dm3.values2d, dm2.values2d, atol=1e-10)


Expand All @@ -723,12 +723,12 @@ def test_general_weighted_demean_oneway(mi_df):
dm1 = y.demean("entity", weights=w)
g = PanelData(DataFrame(y.entity_ids, index=y.index))
dm2 = y.general_demean(g, w)
assert_allclose(dm1.values2d, dm2.values2d)
assert_allclose(dm1.values2d, dm2.values2d, atol=1e-10)

dm1 = y.demean("time", weights=w)
g = PanelData(DataFrame(y.time_ids, index=y.index))
dm2 = y.general_demean(g, w)
assert_allclose(dm1.values2d, dm2.values2d)
assert_allclose(dm1.values2d, dm2.values2d, atol=1e-10)

g = PanelData(DataFrame(np.random.randint(0, 10, g.dataframe.shape), index=y.index))
dm2 = y.general_demean(g, w)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ statsmodels>=0.13.0
mypy_extensions>=0.4
pyhdfe>=0.1
formulaic>=1.0.2
wrapt!=2.0.0rc3
Loading