diff --git a/CHANGELOG.md b/CHANGELOG.md index bfec4729..44ecf4d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ This file records changes to the codebase grouped by version release. Unreleased changes are generally only present during development (relevant parts of the changelog can be written and saved in that section before a version number has been assigned) +## [1.31.5] - 2026-05-26 + +- Update optimization function for compatibility with latest `pyswarm` release +- Update minimum Python version to 3.10 as previous versions are deprecated + ## [1.31.4] - 2026-01-28 - Updated internal functions for Python 3.14 and Pandas 3.0.0 diff --git a/atomica/optimization.py b/atomica/optimization.py index 556e597e..7620a87f 100644 --- a/atomica/optimization.py +++ b/atomica/optimization.py @@ -1452,7 +1452,12 @@ def optimize(project, optimization, parset: ParameterSet, progset: ProgramSet, i errormsg = "PSO optimization requires finite upper and lower bounds to specify the search domain (i.e. every Adjustable needs to have finite bounds)" raise Exception(errormsg) - x_opt, _ = pyswarm.pso(_objective_fcn, kwargs=args, **optim_args) + if sc.compareversions(pyswarm, ">=1.0.0"): + x_opt = pyswarm.pso(_objective_fcn, kwargs=args, **optim_args).x + else: + # On Mac OS, Pyswarm 1.0.0 is not installing yet. This can be revisited and hopefully + # removed once the incompatibility is resolved (possibly by switching to more recent UV pipeline) + x_opt, _ = pyswarm.pso(_objective_fcn, kwargs=args, **optim_args) elif optimization.method == "hyperopt": diff --git a/atomica/version.py b/atomica/version.py index 3277ea6b..fa7668d7 100644 --- a/atomica/version.py +++ b/atomica/version.py @@ -3,5 +3,5 @@ Standard location for module version number and date. """ -version = "1.31.4" -versiondate = "2026-01-28" +version = "1.31.5" +versiondate = "2026-05-26" diff --git a/pyproject.toml b/pyproject.toml index af0cf1e5..e70c3c0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13" ] -requires-python = ">=3.7" +requires-python = ">=3.10" dependencies = [ "matplotlib", @@ -53,4 +53,4 @@ include-package-data = true where = ["."] [tool.setuptools.dynamic] -version = {attr = "atomica.version.version"} \ No newline at end of file +version = {attr = "atomica.version.version"}