Skip to content

Migrate to Python 3.14 + pure uv, update all deps, fix deprecated APIs#1

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/copilot-improvements
Draft

Migrate to Python 3.14 + pure uv, update all deps, fix deprecated APIs#1
Copilot wants to merge 2 commits into
masterfrom
copilot/copilot-improvements

Conversation

Copilot AI commented Jun 1, 2026

Copy link
Copy Markdown

Converts the project from pyenv+poetry to uv-controlled Python (3.14) and packages. All dependencies updated to latest versions compatible with Python 3.14. Deprecated APIs across the codebase fixed to match library breaking changes.

Tooling

  • requires-python = ">=3.14", .python-version3.14, mypy.ini3.14
  • Removed .flake8; ruff replaces flake8/black/isort/pydocstyle throughout
  • Pre-commit: nbqa-isort + nbqa-blacknbqa-ruff + nbqa-ruff-format
  • Dev group cleaned; ruff added as explicit dep

Dependency updates (notable bumps)

Package Before After
pandas 2.2.3 3.0.3
numpy 1.x 2.4.6
sqlalchemy 1.x 2.0.50
mypy 1.3.0 2.1.0
pydot 3.0.4 4.0.1

Deprecated API fixes

SQLAlchemy 2.0 (db_manager/driver.py):

# Before
from sqlalchemy.engine.url import URL
from sqlalchemy.ext.declarative import declarative_base
URL("postgres", ...)
session.query(Model).get(id)

# After
from sqlalchemy import URL
from sqlalchemy.orm import declarative_base
URL.create("postgresql", ...)
session.get(Model, id)

numpy 2.x (gen_manager/crash.py, gen_manager/scenario.py):

# Before
from numpy.random import uniform, multivariate_normal
multivariate_normal(mean=mean, cov=cov, size=n, check_valid="raise")  # check_valid removed in 2.0

# After
np.random.uniform(...)
np.random.default_rng().multivariate_normal(mean=mean, cov=cov, size=n)

pandas 3.0 (opt_manager/stochastic.py):

# Before — DataFrame.append() removed in pandas 2.0
cov_df = cov_df.append(s1)

# After
cov_df = pd.concat([cov_df, pd.DataFrame(index=[sub1_name, sub2_name], columns=cov_df.columns)])

pygmo optional import (opt_manager/stochastic.py): was a hard top-level import; now wrapped in try/except ImportError with a clear error raised at the call site (Pareto branching only).

Typing

All typing.Dict/List/Tuple annotations replaced with built-in generics (dict, list, tuple) across all src/ files.

Copilot AI changed the title Migrate to Python 3.14, pure uv, update all packages Migrate to Python 3.14 + pure uv, update all deps, fix deprecated APIs Jun 1, 2026
Copilot AI requested a review from riccollado June 1, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants