Skip to content

Commit c5839c9

Browse files
committed
Refactor into an internal _samplers sub-package.
1 parent 70af0fd commit c5839c9

6 files changed

Lines changed: 27 additions & 4 deletions

File tree

src/somd2/runner/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ def __init__(self, system, config):
680680
raise ValueError(msg)
681681

682682
# Auto-detect terminal ring groups using Sire connectivity.
683-
from ._terminal_flip import detect_terminal_groups
683+
from ._samplers import detect_terminal_groups
684684

685685
if isinstance(self._system, list):
686686
mols = self._system[0]

src/somd2/runner/_repex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ def __init__(self, system, config):
856856

857857
# Create the terminal flip sampler (if terminal groups were detected).
858858
if self._terminal_groups:
859-
from ._terminal_flip import TerminalFlipSampler
859+
from ._samplers import TerminalFlipSampler
860860

861861
self._terminal_flip_sampler = TerminalFlipSampler(
862862
self._terminal_groups,

src/somd2/runner/_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def generate_lam_vals(lambda_base, increment=0.001):
467467

468468
# Create the terminal flip sampler (if terminal groups were detected).
469469
if self._terminal_groups:
470-
from ._terminal_flip import TerminalFlipSampler
470+
from ._samplers import TerminalFlipSampler
471471

472472
terminal_flip_sampler = TerminalFlipSampler(
473473
self._terminal_groups,
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
######################################################################
2+
# SOMD2: GPU accelerated alchemical free-energy engine.
3+
#
4+
# Copyright: 2023-2026
5+
#
6+
# Authors: The OpenBioSim Team <team@openbiosim.org>
7+
#
8+
# SOMD2 is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU General Public License as published by
10+
# the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# SOMD2 is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU General Public License
19+
# along with SOMD2. If not, see <http://www.gnu.org/licenses/>.
20+
#####################################################################
21+
22+
from ._terminal_flip import TerminalFlipSampler as TerminalFlipSampler
23+
from ._terminal_flip import detect_terminal_groups as detect_terminal_groups
File renamed without changes.

tests/runner/test_terminal_flip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from somd2.config import Config
2424
from somd2.runner import Runner
25-
from somd2.runner._terminal_flip import TerminalFlipSampler, detect_terminal_groups
25+
from somd2.runner._samplers import TerminalFlipSampler, detect_terminal_groups
2626

2727
# ---------------------------------------------------------------------------
2828
# detect_terminal_groups

0 commit comments

Comments
 (0)