Skip to content

Commit a305159

Browse files
dependabot[bot]lars-reimannmegalinter-bot
authored
build(deps): update numpy and dependencies that use it (#929)
Bumps [numpy](https://github.com/numpy/numpy) from 1.26.4 to 2.1.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/numpy/numpy/releases">numpy's releases</a>.</em></p> <blockquote> <h2>2.1.1 (Sep 3, 2024)</h2> <h1>NumPy 2.1.1 Release Notes</h1> <p>NumPy 2.1.1 is a maintenance release that fixes bugs and regressions discovered after the 2.1.0 release.</p> <p>The Python versions supported by this release are 3.10-3.13.</p> <h2>Contributors</h2> <p>A total of 7 people contributed to this release. People with a &quot;+&quot; by their names contributed a patch for the first time.</p> <ul> <li>Andrew Nelson</li> <li>Charles Harris</li> <li>Mateusz Sokół</li> <li>Maximilian Weigand +</li> <li>Nathan Goldbaum</li> <li>Pieter Eendebak</li> <li>Sebastian Berg</li> </ul> <h2>Pull requests merged</h2> <p>A total of 10 pull requests were merged for this release.</p> <ul> <li><a href="https://redirect.github.com/numpy/numpy/pull/27236">#27236</a>: REL: Prepare for the NumPy 2.1.0 release [wheel build]</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27252">#27252</a>: MAINT: prepare 2.1.x for further development</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27259">#27259</a>: BUG: revert unintended change in the return value of set_printoptions</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27266">#27266</a>: BUG: fix reference counting bug in __array_interface__ implementation...</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27267">#27267</a>: TST: Add regression test for missing descr in array-interface</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27276">#27276</a>: BUG: Fix <a href="https://redirect.github.com/numpy/numpy/issues/27256">#27256</a> and <a href="https://redirect.github.com/numpy/numpy/issues/27257">#27257</a></li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27278">#27278</a>: BUG: Fix array_equal for numeric and non-numeric scalar types</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27287">#27287</a>: MAINT: Update maintenance/2.1.x after the 2.0.2 release</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27303">#27303</a>: BLD: cp311- macosx_arm64 wheels [wheel build]</li> <li><a href="https://redirect.github.com/numpy/numpy/pull/27304">#27304</a>: BUG: f2py: better handle filtering of public/private subroutines</li> </ul> <h2>Checksums</h2> <h3>MD5</h3> <pre><code>3053a97400db800b7377749e691eb39e numpy-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl 84b752a2220dce7c96ff89eef4f4aec3 numpy-2.1.1-cp310-cp310-macosx_11_0_arm64.whl 47ed4f704a64261f07ca24ef2e674524 numpy-2.1.1-cp310-cp310-macosx_14_0_arm64.whl b8a45caa870aee980c298053cf064d28 numpy-2.1.1-cp310-cp310-macosx_14_0_x86_64.whl e097ad5eee572b791b4a25eedad6df4a numpy-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl ae502c99315884cda7f0236a07c035c4 numpy-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl 841a859d975c55090c0b60b72aab93a3 numpy-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl d51be2b17f5b87aac64ab80fdfafc85e numpy-2.1.1-cp310-cp310-musllinux_1_2_aarch64.whl 1f8249bd725397c6233fe6a0e8ad18b1 numpy-2.1.1-cp310-cp310-win32.whl d38d6f06589c1ec104a6a31ff6035781 numpy-2.1.1-cp310-cp310-win_amd64.whl </code></pre> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/numpy/numpy/commit/48606ab22bfdb0e9d7ec4ed5eef984b873b7796d"><code>48606ab</code></a> Merge pull request <a href="https://redirect.github.com/numpy/numpy/issues/27328">#27328</a> from charris/prepare-2.1.1</li> <li><a href="https://github.com/numpy/numpy/commit/a7cb4c473ee22eb7399a245b894137b12c26a5d2"><code>a7cb4c4</code></a> REL: Prepare for the NumPy 2.1.1 release [wheel build]</li> <li><a href="https://github.com/numpy/numpy/commit/884c92ba8bd2036b17319a8e384679c35c3b4a14"><code>884c92b</code></a> Merge pull request <a href="https://redirect.github.com/numpy/numpy/issues/27303">#27303</a> from charris/backport-27284</li> <li><a href="https://github.com/numpy/numpy/commit/ca7f5c169b36a7ec235d93dea9a7cd4ad6cef158"><code>ca7f5c1</code></a> Merge pull request <a href="https://redirect.github.com/numpy/numpy/issues/27304">#27304</a> from charris/backport-27049</li> <li><a href="https://github.com/numpy/numpy/commit/2a49507d02cbf0e3ce6c540a162c3771195d9b37"><code>2a49507</code></a> BUG: f2py: better handle filtering of public/private subroutines</li> <li><a href="https://github.com/numpy/numpy/commit/d4306dd2c498a5bbc74e0b26ae60b64a5a4e8c5c"><code>d4306dd</code></a> TST: Add regression test for <a href="https://redirect.github.com/numpy/numpy/issues/26920">gh-26920</a></li> <li><a href="https://github.com/numpy/numpy/commit/db9668dfb89ac89dec826591b7cf73fd7f47d7b5"><code>db9668d</code></a> BLD: cp311- macosx_arm64 wheels [wheel build]</li> <li><a href="https://github.com/numpy/numpy/commit/c6ff254c6e9c493b243855db95217e23231e18a9"><code>c6ff254</code></a> Merge pull request <a href="https://redirect.github.com/numpy/numpy/issues/27287">#27287</a> from charris/post-2.0.2-release-update</li> <li><a href="https://github.com/numpy/numpy/commit/326bc17ec19c26129e40485f8c539686efa0e289"><code>326bc17</code></a> MAINT: Update main after the 2.0.2 release</li> <li><a href="https://github.com/numpy/numpy/commit/8164b7cfe65c33c6727fc129607f81738d608eac"><code>8164b7c</code></a> Merge pull request <a href="https://redirect.github.com/numpy/numpy/issues/27278">#27278</a> from charris/backport-27275</li> <li>Additional commits viewable in <a href="https://github.com/numpy/numpy/compare/v1.26.4...v2.1.1">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=numpy&package-manager=pip&previous-version=1.26.4&new-version=2.1.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lars Reimann <[email protected]> Co-authored-by: megalinter-bot <[email protected]>
1 parent f61dc32 commit a305159

22 files changed

+2145
-2007
lines changed

poetry.lock

+1,411-1,269
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ packages = [
1616
python = "^3.11,<3.13"
1717
apipkg = "^3.0.2"
1818
matplotlib = "^3.6.3"
19+
numpy = "<3.0.0"
1920
pillow = ">=9.5,<11.0"
20-
polars = {extras = ["numpy", "pyarrow"], version = "^0.20.25"}
21+
polars = {extras = ["numpy", "pyarrow"], version = "^1.7.1"}
2122
scikit-learn = "^1.2.0"
2223
statsmodels = "^0.14.1"
23-
torch = "^2.3.0"
24-
torchvision = "^0.18.0"
25-
xxhash = "^3.4.1"
24+
torch = "^2.4.1"
25+
torchvision = "^0.19.1"
2626
transformers = "^4.40.2"
27-
numpy = "<2.0.0"
27+
xxhash = "^3.4.1"
2828

2929
[tool.poetry.group.dev.dependencies]
3030
pytest = ">=7.2.1,<9.0.0"
@@ -33,14 +33,14 @@ syrupy = "^4.6.0"
3333
torch = [
3434
# Install the CUDA version on Windows. Projects that depend on us always get their dependencies from PyPI, so
3535
# there's no point moving this to the main dependencies section.
36-
{ version = "^2.3.0", markers="sys_platform == 'win32'", source = "torch_cuda" },
37-
{ version = "^2.3.0", markers="sys_platform != 'win32'", source = "pypi" },
36+
{ version = "^2.4.1", markers="sys_platform == 'win32'", source = "torch_cuda" },
37+
{ version = "^2.4.1", markers="sys_platform != 'win32'", source = "pypi" },
3838
]
3939
torchvision = [
4040
# Install the CUDA version on Windows. Projects that depend on us always get their dependencies from PyPI, so
4141
# there's no point moving this to the main dependencies section.
42-
{ version = "^0.18.0", markers="sys_platform == 'win32'", source = "torch_cuda" },
43-
{ version = "^0.18.0", markers="sys_platform != 'win32'", source = "pypi" },
42+
{ version = "^0.19.1", markers="sys_platform == 'win32'", source = "torch_cuda" },
43+
{ version = "^0.19.1", markers="sys_platform != 'win32'", source = "pypi" },
4444
]
4545

4646
[tool.poetry.group.docs.dependencies]

src/resources/from_json_file.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
{
2-
"columns": [
3-
{ "name": "a", "datatype": "Int64", "bit_settings": "", "values": [1, 2, 3] },
4-
{ "name": "b", "datatype": "Int64", "bit_settings": "", "values": [4, 5, 6] }
5-
]
6-
}
1+
[
2+
{ "a": 1, "b": 4 },
3+
{ "a": 2, "b": 5 },
4+
{ "a": 3, "b": 6 }
5+
]

src/resources/to_json_file.json

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
{
2-
"columns": [
3-
{ "name": "a", "datatype": "Int64", "bit_settings": "", "values": [1, 2, 3] },
4-
{ "name": "b", "datatype": "Int64", "bit_settings": "", "values": [4, 5, 6] }
5-
]
6-
}
1+
[
2+
{ "a": 1, "b": 4 },
3+
{ "a": 2, "b": 5 },
4+
{ "a": 3, "b": 6 }
5+
]

src/resources/to_parquet_file.parquet

162 Bytes
Binary file not shown.

src/safeds/data/tabular/containers/_column.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def __init__(self, name: str, data: Sequence[T_co] | None = None) -> None:
7474
if data is None:
7575
data = []
7676

77-
self._series: pl.Series = pl.Series(name, data)
77+
self._series: pl.Series = pl.Series(name, data, strict=False)
7878

7979
def __contains__(self, item: Any) -> bool:
8080
return self._series.__contains__(item)
@@ -84,7 +84,7 @@ def __eq__(self, other: object) -> bool:
8484
return NotImplemented
8585
if self is other:
8686
return True
87-
return self._series.equals(other._series)
87+
return self.name == other.name and self._series.equals(other._series)
8888

8989
@overload
9090
def __getitem__(self, index: int) -> T_co: ...

src/safeds/data/tabular/containers/_table.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def from_json_file(path: str | Path) -> Table:
242242

243243
try:
244244
return Table._from_polars_data_frame(pl.read_json(path))
245-
except pl.PolarsPanicError:
245+
except (pl.exceptions.PanicException, pl.exceptions.ComputeError):
246246
# Can happen if the JSON file is empty (https://github.com/pola-rs/polars/issues/10234)
247247
return Table()
248248

@@ -322,7 +322,7 @@ def __init__(self, data: Mapping[str, Sequence[Any]] | None = None) -> None:
322322
)
323323

324324
# Implementation
325-
self._lazy_frame: pl.LazyFrame = pl.LazyFrame(data)
325+
self._lazy_frame: pl.LazyFrame = pl.LazyFrame(data, strict=False)
326326
self.__data_frame_cache: pl.DataFrame | None = None # Scramble the name to prevent access from outside
327327

328328
def __eq__(self, other: object) -> bool:
@@ -425,10 +425,10 @@ def schema(self) -> Schema:
425425
import polars as pl
426426

427427
try:
428-
return _PolarsSchema(self._lazy_frame.schema)
429-
except (pl.NoDataError, pl.PolarsPanicError):
428+
return _PolarsSchema(self._lazy_frame.collect_schema())
429+
except (pl.exceptions.NoDataError, pl.exceptions.PanicException):
430430
# Can happen for some operations on empty tables (e.g. https://github.com/pola-rs/polars/issues/16202)
431-
return _PolarsSchema({})
431+
return _PolarsSchema(pl.Schema({}))
432432

433433
# ------------------------------------------------------------------------------------------------------------------
434434
# Column operations
@@ -698,7 +698,7 @@ def remove_columns(
698698
_check_columns_exist(self, names)
699699

700700
return Table._from_polars_lazy_frame(
701-
self._lazy_frame.drop(names),
701+
self._lazy_frame.drop(names, strict=not ignore_unknown_names),
702702
)
703703

704704
def remove_columns_except(
@@ -1919,8 +1919,6 @@ def to_dict(self) -> dict[str, list[Any]]:
19191919
def to_json_file(
19201920
self,
19211921
path: str | Path,
1922-
*,
1923-
orientation: Literal["column", "row"] = "column",
19241922
) -> None:
19251923
"""
19261924
Write the table to a JSON file.
@@ -1934,10 +1932,6 @@ def to_json_file(
19341932
----------
19351933
path:
19361934
The path to the JSON file. If the file extension is omitted, it is assumed to be ".json".
1937-
orientation:
1938-
The orientation of the JSON file. If "column", the JSON file will be structured as a list of columns. If
1939-
"row", the JSON file will be structured as a list of rows. Row orientation is more human-readable, but
1940-
slower and less memory-efficient.
19411935
19421936
Raises
19431937
------
@@ -1954,7 +1948,7 @@ def to_json_file(
19541948
path.parent.mkdir(parents=True, exist_ok=True)
19551949

19561950
# Write JSON to file
1957-
self._data_frame.write_json(path, row_oriented=(orientation == "row"))
1951+
self._data_frame.write_json(path)
19581952

19591953
def to_parquet_file(self, path: str | Path) -> None:
19601954
"""

src/safeds/data/tabular/typing/_polars_schema.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ class _PolarsSchema(Schema):
2626
# Dunder methods
2727
# ------------------------------------------------------------------------------------------------------------------
2828

29-
def __init__(self, schema: dict[str, pl.DataType]):
30-
self._schema: dict[str, pl.DataType] = schema
29+
def __init__(self, schema: pl.Schema):
30+
self._schema: pl.Schema = schema
3131

3232
def __eq__(self, other: object) -> bool:
3333
if not isinstance(other, _PolarsSchema):
@@ -66,7 +66,7 @@ def __str__(self) -> str:
6666

6767
@property
6868
def column_names(self) -> list[str]:
69-
return list(self._schema.keys())
69+
return list(self._schema.names())
7070

7171
# ------------------------------------------------------------------------------------------------------------------
7272
# Getters

0 commit comments

Comments
 (0)