Skip to content

Commit 211ec65

Browse files
timmensclaude
andcommitted
Remove test-old-numpy compat environment
Also fix missing return in compat.py and end-of-file in config.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4debf37 commit 211ec65

5 files changed

Lines changed: 46 additions & 82 deletions

File tree

.github/workflows/main.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@ jobs:
6363
- name: Run pytest
6464
shell: bash -el {0}
6565
run: pixi run -e test-py${{ matrix.python-version }} tests-fast
66-
run-tests-with-old-numpy:
67-
name: Run tests on ubuntu-latest with numpy < 2
68-
runs-on: ubuntu-latest
69-
steps:
70-
- uses: actions/checkout@v4
71-
- uses: prefix-dev/setup-pixi@v0.9.4
72-
with:
73-
pixi-version: v0.65.0
74-
cache: true
75-
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
76-
frozen: true
77-
environments: test-old-numpy
78-
- name: Run pytest
79-
shell: bash -el {0}
80-
run: pixi run -e test-old-numpy tests-fast
8166
run-tests-with-old-plotly:
8267
name: Run tests on ubuntu-latest with plotly < 6
8368
runs-on: ubuntu-latest

pixi.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 34 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ name = "optimagic"
66
description = "Tools to solve difficult numerical optimization problems."
77
requires-python = ">=3.12"
88
dependencies = [
9-
"cloudpickle",
10-
"joblib",
11-
"numpy",
12-
"pandas",
13-
"plotly",
9+
"cloudpickle>=2.2",
10+
"joblib>=1.1",
11+
"numpy>=1.26",
12+
"pandas>=2.1",
13+
"plotly>=5.14",
1414
"pybaum>=0.1.2",
15-
"scipy>=1.2.1",
16-
"sqlalchemy>=1.3",
17-
"annotated-types",
18-
"typing-extensions",
15+
"scipy>=1.11",
16+
"sqlalchemy>=2.0",
17+
"annotated-types>=0.4",
18+
"typing-extensions>=4.5",
1919
]
2020
dynamic = ["version"]
2121
keywords = [
@@ -404,35 +404,35 @@ platforms = ["linux-64", "osx-arm64", "win-64"]
404404
[tool.pixi.dependencies]
405405
python = ">=3.12,<3.15"
406406
# Prefer conda-forge builds for compiled scientific packages
407-
numpy = "*"
408-
scipy = ">=1.2.1"
409-
pandas = "<3"
410-
jupyterlab = "*"
407+
numpy = ">=1.26"
408+
scipy = ">=1.11"
409+
pandas = ">=2.1,<3"
410+
jupyterlab = ">=4.0"
411411
cyipopt = ">=1.4.0"
412412
pygmo = ">=2.19.0"
413-
nlopt = "*"
414-
statsmodels = "*"
415-
matplotlib = "*"
416-
bokeh = "*"
417-
altair = "*"
418-
seaborn = "*"
419-
pyyaml = "*"
420-
jinja2 = "*"
413+
nlopt = ">=2.7"
414+
statsmodels = ">=0.14"
415+
matplotlib = ">=3.8"
416+
bokeh = ">=3.2"
417+
altair = ">=5.1"
418+
seaborn = ">=0.13"
419+
pyyaml = ">=6.0.1"
420+
jinja2 = ">=3.1"
421421
tranquilo = ">=0.1.1"
422-
iminuit = "*"
423-
cma = "*"
424-
pygad = "*"
425-
pytorch-cpu = "*"
422+
iminuit = ">=2.25"
423+
cma = ">=3.3"
424+
pygad = ">=3.2"
425+
pytorch-cpu = ">=2.2"
426426

427427
[tool.pixi.pypi-dependencies]
428428
optimagic = { path = ".", editable = true }
429-
bayesian-optimization = "*"
429+
bayesian-optimization = ">=1.4"
430430
dfo-ls = ">=1.5.3"
431-
py-bobyqa = "*"
431+
py-bobyqa = ">=1.3"
432432
fides = "==0.7.4"
433-
kaleido = "*"
433+
kaleido = ">=0.2.1"
434434
gradient-free-optimizers = ">=1.6.0"
435-
pyswarms = "*"
435+
pyswarms = ">=1.3"
436436

437437
# --- Python version features --------------------------------------------------------
438438
[tool.pixi.feature.py312.dependencies]
@@ -444,9 +444,9 @@ python = "~=3.14.0"
444444

445445
# --- Feature: test (test infrastructure) ---------------------------------------------
446446
[tool.pixi.feature.test.dependencies]
447-
pytest = "*"
448-
pytest-cov = "*"
449-
pytest-xdist = "*"
447+
pytest = ">=7.2"
448+
pytest-cov = ">=4.0"
449+
pytest-xdist = ">=3.2"
450450

451451
[tool.pixi.feature.test.tasks]
452452
tests = "pytest"
@@ -471,8 +471,8 @@ mypy = "mypy"
471471
[tool.pixi.feature.linux]
472472
platforms = ["linux-64"]
473473
[tool.pixi.feature.linux.dependencies]
474-
jax = ">=0.4.1"
475-
petsc4py = "*"
474+
jax = ">=0.4.8"
475+
petsc4py = ">=3.18"
476476

477477
# --- Feature: docs -------------------------------------------------------------------
478478
[tool.pixi.feature.docs.dependencies]
@@ -497,10 +497,6 @@ intersphinx-registry = "*"
497497
build-docs = { cmd = "make html", cwd = "docs" }
498498

499499
# --- Compat features (version overrides for backward-compat CI) ---------------------
500-
[tool.pixi.feature.old-numpy.dependencies]
501-
numpy = "<2"
502-
pandas = ">=2"
503-
504500
[tool.pixi.feature.old-plotly.dependencies]
505501
plotly = "<6"
506502

@@ -524,7 +520,6 @@ test-py312 = { features = ["test", "py312"], solve-group = "py312" }
524520
test-py313 = { features = ["test", "py313"], solve-group = "py313" }
525521
test-py314 = { features = ["test", "py314"], solve-group = "py314" }
526522
# Backward-compat CI (Python 3.12, lowest supported)
527-
test-old-numpy = { features = ["test", "old-numpy", "py312"] }
528523
test-old-plotly = { features = ["test", "old-plotly", "py312"] }
529524
# Nevergrad CI (bayesian-optimization==1.4.0)
530525
test-nevergrad-py312 = { features = ["test", "nevergrad", "py312"] }

src/optimagic/config.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import importlib.util
22
from pathlib import Path
33

4-
import pandas as pd
54
import plotly.express as px
6-
from packaging import version
75

86
DOCS_DIR = Path(__file__).parent.parent / "docs"
97
OPTIMAGIC_ROOT = Path(__file__).parent
@@ -74,11 +72,3 @@ def _is_installed(module_name: str) -> bool:
7472
IS_MATPLOTLIB_INSTALLED = _is_installed("matplotlib")
7573
IS_BOKEH_INSTALLED = _is_installed("bokeh")
7674
IS_ALTAIR_INSTALLED = _is_installed("altair")
77-
78-
# ======================================================================================
79-
# Check if pandas version is newer or equal to version 2.1.0
80-
# ======================================================================================
81-
82-
IS_PANDAS_VERSION_NEWER_OR_EQUAL_TO_2_1_0 = version.parse(
83-
pd.__version__
84-
) >= version.parse("2.1.0")

src/optimagic/shared/compat.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
66
"""
77

8-
from optimagic.config import IS_PANDAS_VERSION_NEWER_OR_EQUAL_TO_2_1_0
9-
108

119
def pd_df_map(df, func, na_action=None, **kwargs):
1210
"""Apply a function to a Dataframe elementwise.
@@ -26,8 +24,4 @@ def pd_df_map(df, func, na_action=None, **kwargs):
2624
pd.DataFrame: Transformed DataFrame.
2725
2826
"""
29-
if IS_PANDAS_VERSION_NEWER_OR_EQUAL_TO_2_1_0:
30-
out = df.map(func, na_action=na_action, **kwargs)
31-
else:
32-
out = df.applymap(func, na_action=na_action, **kwargs)
33-
return out
27+
return df.map(func, na_action=na_action, **kwargs)

0 commit comments

Comments
 (0)