File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
2525
2626* Fixed parsing of AMBER and GROMACS GLYCAM force field topologies.
2727
28+ * Fix hang in ``sire.load `` function when shared GROMACS topology path is missing.
29+
2830`2025.4.0 <https://github.com/openbiosim/sire/compare/2025.3.0...2025.4.0 >`__ - February 2026
2931---------------------------------------------------------------------------------------------
3032
Original file line number Diff line number Diff line change @@ -77,11 +77,16 @@ def _get_gromacs_dir():
7777
7878 if not os .path .exists (gromacs_tbz2 ):
7979 try :
80+ import socket
8081 import urllib .request
8182
82- urllib .request .urlretrieve (f"{ tutorial_url } /gromacs.tar.bz2" , gromacs_tbz2 )
83- except Exception :
84- # we cannot download - just give up
83+ with urllib .request .urlopen (
84+ f"{ tutorial_url } /gromacs.tar.bz2" , timeout = 5
85+ ) as response :
86+ with open (gromacs_tbz2 , "wb" ) as f :
87+ f .write (response .read ())
88+ except (Exception , socket .timeout ):
89+ # we cannot download - continue without GROMACS
8590 return None
8691
8792 if not os .path .exists (gromacs_tbz2 ):
@@ -443,7 +448,7 @@ def load(
443448 gromacs_path = _get_gromacs_dir ()
444449
445450 m = {
446- "GROMACS_PATH" : _get_gromacs_dir () ,
451+ "GROMACS_PATH" : gromacs_path ,
447452 "show_warnings" : show_warnings ,
448453 "parallel" : parallel ,
449454 "ignore_topology_frame" : ignore_topology_frame ,
You can’t perform that action at this time.
0 commit comments