Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
Expand All @@ -28,7 +28,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
python-version: ['3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
Expand All @@ -49,7 +49,7 @@ jobs:
runs-on: macOS-latest
strategy:
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']
python-version: ['3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v6
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ipqa-research/ugropy/blob/main/docs/source/tutorial/easy_way.ipynb)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://tldrlegal.com/license/mit-license)
![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-blue)
![Python 3.12+](https://img.shields.io/badge/Python-3.12%2B-blue)
[![Docs](https://img.shields.io/badge/docs%20-%20green?style=flat&label=Sphinx&link=https%3A%2F%2Fipqa-research.github.io%2Fugropy%2Findex.html)](https://salvadorbrandolin.github.io/ugropy/)
[![PyPI
version](https://badge.fury.io/py/ugropy.svg)](https://badge.fury.io/py/ugropy)
Expand All @@ -19,7 +19,7 @@ representation from PubChem. In both cases, `ugropy` uses the
in the molecule.


`ugropy` is tested for `Python` 3.10, 3.11, 3.12, 3.13 and 3.14 on Linux,
`ugropy` is tested for `Python` 3.12, 3.13 and 3.14 on Linux,
Windows and Mac OS.

<!-- docs-include-end -->
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ matplotlib
pytest

thermo >= 0.2.27
yaeos
yaeos; sys_platform != "darwin"
toml
xpress
22 changes: 12 additions & 10 deletions docs/source/tutorial/writers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -203,17 +203,19 @@
}
],
"source": [
"from yaeos import UNIFACVLE\n",
"\n",
"from ugropy import unifac\n",
"\n",
"try:\n",
" from yaeos import UNIFACVLE\n",
"except ImportError:\n",
" print(\"yaeos not available on this platform, skipping...\")\n",
"else:\n",
" from ugropy import unifac\n",
"\n",
"names = [\"hexane\", \"ethanol\"]\n",
"grps = [unifac.get_groups(n) for n in names]\n",
"yaeos_groups = [g.subgroups_num for g in grps]\n",
" names = [\"hexane\", \"ethanol\"]\n",
" grps = [unifac.get_groups(n) for n in names]\n",
" yaeos_groups = [g.subgroups_num for g in grps]\n",
"\n",
"GE_yaeos = UNIFACVLE(yaeos_groups)\n",
"GE_yaeos.ln_gamma([0.5, 0.5], 60+273.15)"
" GE_yaeos = UNIFACVLE(yaeos_groups)\n",
" GE_yaeos.ln_gamma([0.5, 0.5], 60+273.15)"
]
},
{
Expand Down Expand Up @@ -287,4 +289,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
11 changes: 7 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ requires = ["setuptools", "wheel"]

[tool.black]
line-length = 79
target-version = ["py310"]
target-version = ["py312"]

[tool.pytest.ini_options]
markers = [
Expand Down Expand Up @@ -37,7 +37,7 @@ markers = [

[project]
name = "ugropy"
version = "3.2.0"
version = "3.2.5"
authors = [{name = "Brandolín, Salvador Eduardo", email = "salvadorebrandolin@mi.unc.edu.ar"}]
license = {text = "The MIT License"}
readme = "README.md"
Expand All @@ -48,9 +48,12 @@ classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
]
requires-python = ">=3.12"

urls = {Homepage = "https://github.com/ipqa-research/ugropy"}

Expand All @@ -59,7 +62,7 @@ dependencies = [
"pandas >= 2.0.3",
"pubchempy >= 1.0.5",
"pint >= 0.22",
"pulp >= 3.3.2",
"pulp[cbc] >= 4.0.0",
# "pulp >= 2.9.0; sys_platform != 'darwin'",
# "pulp == 2.9.0; sys_platform == 'darwin'",
]
6 changes: 1 addition & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ envlist =
docstyle,
check-manifest,
docs,
py310,
py311,
py312,
py313,
py314,
Expand All @@ -18,9 +16,7 @@ envlist =
# =============================================================================
[gh-actions]
python =
3.10: py310, style, docstyle, check-manifest, coverage, docs
3.11: py311
3.12: py312
3.12: py312, style, docstyle, check-manifest, coverage, docs
3.13: py313
3.14: py314

Expand Down
15 changes: 8 additions & 7 deletions ugropy/core/ilp_solvers/default_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def solve_one_problem(self, not_valid_solutions: List = []) -> List[int]:
# less elements than the previous ones, otherwise the first one was not
# optimal.
if not_valid_solutions:
opt = np.sum(np.array(not_valid_solutions[0], dtype=int))
opt = int(np.sum(np.array(not_valid_solutions[0], dtype=int)))

if not self.search_nonoptimal:
# Do you want to search only optimals solutions?
Expand All @@ -71,23 +71,24 @@ def solve_one_problem(self, not_valid_solutions: List = []) -> List[int]:
<= pulp.lpSum([solution[i] for i in range(n_frag)]) - 1
)

# Solver configuration verbosity
solver = pulp.getSolver(self.solver_arguments["solver"], msg=False)
# Solver configuration - respect solver_arguments
solver_name = self.solver_arguments.get("solver", "COIN_CMD")
solver = pulp.getSolver(solver_name, msg=False)

# Solve
problem.solve(solver)
stats = problem.solve(solver)

# Selected fragments (solution)
if pulp.LpStatus[problem.status] == "Optimal":
if stats.has_solution:
selected_subsets = [
name
for i, name in enumerate(self.overlapped_fragments.keys())
if pulp.value(x[i]) == 1
if x[i].varValue == 1
]

self.selected_fragments.append(selected_subsets)

return [pulp.value(x[i]) for i in range(n_frag)]
return [int(x[i].varValue) for i in range(n_frag)]
else:
# No feasible problem
return None
Expand Down
2 changes: 1 addition & 1 deletion ugropy/core/ilp_solvers/ilp_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(

if solver_arguments == {}:
self.solver_arguments = {
"solver": "PULP_CBC_CMD",
"solver": "COIN_CMD",
}
else:
self.solver_arguments = solver_arguments
Expand Down
Loading