Skip to content

Commit

Permalink
Merge branch 'main' into fix-index-tensor-on-cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann authored Nov 26, 2024
2 parents 58b0067 + 5b32acc commit e356696
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 0 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
# Documentation
/docs/ @Safe-DS/Library
/mkdocs.yml @Safe-DS/Library

# Code
/src/ @lars-reimann @Gerhardsa0 @Marsmaennchen221 @sibre28
/tests/ @lars-reimann @Gerhardsa0 @Marsmaennchen221 @sibre28
10 changes: 5 additions & 5 deletions src/safeds/data/tabular/containers/_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,22 +1007,22 @@ def transform_column(
# ------------------------------------------------------------------------------------------------------------------

@overload
def count_row_if(
def count_rows_if(
self,
predicate: Callable[[Row], Cell[bool | None]],
*,
ignore_unknown: Literal[True] = ...,
) -> int: ...

@overload
def count_row_if(
def count_rows_if(
self,
predicate: Callable[[Row], Cell[bool | None]],
*,
ignore_unknown: bool,
) -> int | None: ...

def count_row_if(
def count_rows_if(
self,
predicate: Callable[[Row], Cell[bool | None]],
*,
Expand Down Expand Up @@ -1059,10 +1059,10 @@ def count_row_if(
--------
>>> from safeds.data.tabular.containers import Table
>>> table = Table({"col1": [1, 2, 3], "col2": [1, 3, 3]})
>>> table.count_row_if(lambda row: row["col1"] == row["col2"])
>>> table.count_rows_if(lambda row: row["col1"] == row["col2"])
2
>>> table.count_row_if(lambda row: row["col1"] > row["col2"])
>>> table.count_rows_if(lambda row: row["col1"] > row["col2"])
0
"""
expression = predicate(_LazyVectorizedRow(self))._polars_expression
Expand Down
4 changes: 2 additions & 2 deletions src/safeds/ml/nn/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(
self._total_number_of_epochs_done = 0

@staticmethod
def load_pretrained_model(huggingface_repo: str) -> NeuralNetworkRegressor: # pragma: no cover
def from_pretrained_model(huggingface_repo: str) -> NeuralNetworkRegressor: # pragma: no cover
"""
Load a pretrained model from a [Huggingface repository](https://huggingface.co/models/).
Expand Down Expand Up @@ -703,7 +703,7 @@ def __init__(
self._total_number_of_epochs_done = 0

@staticmethod
def load_pretrained_model(huggingface_repo: str) -> NeuralNetworkClassifier: # pragma: no cover
def from_pretrained_model(huggingface_repo: str) -> NeuralNetworkClassifier: # pragma: no cover
"""
Load a pretrained model from a [Huggingface repository](https://huggingface.co/models/).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from safeds.data.tabular.containers import Table


Expand Down Expand Up @@ -30,7 +31,7 @@ def test_should_handle_boolean_logic(
expected: int,
) -> None:
table = Table({"a": values})
assert table.count_row_if(lambda row: row["a"] < 2) == expected
assert table.count_rows_if(lambda row: row["a"] < 2) == expected


@pytest.mark.parametrize(
Expand Down Expand Up @@ -61,4 +62,4 @@ def test_should_handle_kleene_logic(
expected: int | None,
) -> None:
table = Table({"a": values})
assert table.count_row_if(lambda row: row["a"] < 2, ignore_unknown=False) == expected
assert table.count_rows_if(lambda row: row["a"] < 2, ignore_unknown=False) == expected

0 comments on commit e356696

Please sign in to comment.