Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 4
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand All @@ -32,7 +32,7 @@ jobs:
- if: matrix.python-version == '3.9'
name: Check works with min requirements
run: hatch run test_min:pytest tests
- if: matrix.python-version == '3.9'
- if: matrix.python-version == '3.14'
name: Lint
run: hatch run lint:check
- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion formulaic/materializers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def _get_scoped_terms_spanned_by_evaled_factors(
factors: list[tuple[Union[ScopedFactor, int], ...]] = []
for factor in evaled_factors:
if factor.metadata.kind is Factor.Kind.CONSTANT:
scale *= factor.values
scale *= factor.values # type: ignore[operator]
elif factor.metadata.spans_intercept:
factors.append((ScopedFactor(factor, reduced=True), 1))
else:
Expand Down
4 changes: 2 additions & 2 deletions formulaic/materializers/narwhals.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import functools
import itertools
from collections.abc import Sequence
from collections.abc import Mapping, Sequence
from typing import TYPE_CHECKING, Any

import narwhals.stable.v1 as nw
Expand Down Expand Up @@ -42,7 +42,7 @@ def _init(self) -> None:

@override # type: ignore
@property
def data_context(self):
def data_context(self) -> Mapping[str, Any]:
return self.__data_context

@override
Expand Down
6 changes: 3 additions & 3 deletions formulaic/model_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@ def get_model_matrix(
from formulaic import ModelMatrices

if attr_overrides:
return ModelSpec.from_spec(self, **attr_overrides).get_model_matrix(
data, context=context, drop_rows=drop_rows
)
return cast(
ModelSpecs, ModelSpec.from_spec(self, **attr_overrides)
).get_model_matrix(data, context=context, drop_rows=drop_rows)

# Check whether we can generate model matrices jointly (i.e. all
# materializers and their params are the same)
Expand Down
4 changes: 3 additions & 1 deletion formulaic/transforms/poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,6 @@ def get_beta(k: int) -> float:
out[nonnull_indices, :] = P[:, 1:]

# Return basis dropping the first (constant) column
return FactorValues(out, column_names=tuple(str(i) for i in range(1, degree + 1)))
return FactorValues[numpy.ndarray]( # type: ignore[return-value]
out, column_names=tuple(str(i) for i in range(1, degree + 1))
)
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
requires-python = ">=3.9"
dependencies = [
Expand Down