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
2 changes: 2 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.

* Fixed parsing of AMBER and GROMACS GLYCAM force field topologies.

* Fix hang in ``sire.load`` function when shared GROMACS topology path is missing.

`2025.4.0 <https://github.com/openbiosim/sire/compare/2025.3.0...2025.4.0>`__ - February 2026
---------------------------------------------------------------------------------------------

Expand Down
13 changes: 9 additions & 4 deletions src/sire/_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,16 @@ def _get_gromacs_dir():

if not os.path.exists(gromacs_tbz2):
try:
import socket
import urllib.request

urllib.request.urlretrieve(f"{tutorial_url}/gromacs.tar.bz2", gromacs_tbz2)
except Exception:
# we cannot download - just give up
with urllib.request.urlopen(
f"{tutorial_url}/gromacs.tar.bz2", timeout=5
) as response:
with open(gromacs_tbz2, "wb") as f:
f.write(response.read())
except (Exception, socket.timeout):
# we cannot download - continue without GROMACS
return None

if not os.path.exists(gromacs_tbz2):
Expand Down Expand Up @@ -443,7 +448,7 @@ def load(
gromacs_path = _get_gromacs_dir()

m = {
"GROMACS_PATH": _get_gromacs_dir(),
"GROMACS_PATH": gromacs_path,
"show_warnings": show_warnings,
"parallel": parallel,
"ignore_topology_frame": ignore_topology_frame,
Expand Down