Compare c9a70b5 ... +0 ... cabf1f6


@@ -1,7 +1,6 @@
Loading
1 1
import logging
2 2
3 3
import numpy as np
4 -
5 4
from paprika.utils import override_dict
6 5
7 6
logger = logging.getLogger(__name__)
@@ -127,6 +126,15 @@
Loading
127 126
    ):
128 127
        bias_type = "upper_walls"
129 128
129 +
    elif (
130 +
        amber_restraint_values["r2"] < amber_restraint_values["r3"]
131 +
        or amber_restraint_values["r2"] == 0.0
132 +
    ) and (
133 +
        amber_restraint_values["rk2"] <= amber_restraint_values["rk3"]
134 +
        or amber_restraint_values["rk2"] == 0.0
135 +
    ):
136 +
        bias_type = "upper_walls"
137 +
130 138
    elif (
131 139
        amber_restraint_values["r2"] > amber_restraint_values["r3"]
132 140
        or amber_restraint_values["r3"] == 0.0
@@ -139,6 +147,12 @@
Loading
139 147
    ):
140 148
        bias_type = "lower_walls"
141 149
150 +
    elif (amber_restraint_values["r2"] < amber_restraint_values["r3"]) and (
151 +
        amber_restraint_values["rk2"] > amber_restraint_values["rk3"]
152 +
        or amber_restraint_values["rk3"] == 0.0
153 +
    ):
154 +
        bias_type = "lower_walls"
155 +
142 156
    if bias_type is None:
143 157
        raise Exception("Could not determine bias potential type from restraint.")
144 158

@@ -685,6 +685,30 @@
Loading
685 685
    assert get_bias_potential_type(upper, "attach", 0) == "upper_walls"
686 686
    assert get_bias_potential_type(upper, "attach", 1) == "upper_walls"
687 687
688 +
    # Test upper wall restraint (3)
689 +
    upper = DAT_restraint()
690 +
    upper.auto_apr = False
691 +
    upper.amber_index = True
692 +
    upper.topology = os.path.join(os.path.dirname(__file__), "../data/k-cl/k-cl.pdb")
693 +
    upper.mask1 = "@K+"
694 +
    upper.mask2 = "@Cl-"
695 +
696 +
    upper.attach["fc_initial"] = 1.0
697 +
    upper.attach["fc_final"] = 1.0
698 +
699 +
    upper.custom_restraint_values["rk2"] = 0.0
700 +
    upper.custom_restraint_values["rk3"] = 1.0
701 +
    upper.custom_restraint_values["r2"] = 0.0
702 +
    upper.custom_restraint_values["r3"] = 3.5
703 +
704 +
    upper.attach["target"] = 3.5
705 +
    upper.attach["num_windows"] = len(attach_fractions)
706 +
707 +
    upper.initialize()
708 +
709 +
    assert get_bias_potential_type(upper, "attach", 0) == "upper_walls"
710 +
    assert get_bias_potential_type(upper, "attach", 1) == "upper_walls"
711 +
688 712
    # Test lower wall restraint (1)
689 713
    lower = DAT_restraint()
690 714
    lower.auto_apr = False
@@ -732,3 +756,27 @@
Loading
732 756
733 757
    assert get_bias_potential_type(lower, "attach", 0) == "lower_walls"
734 758
    assert get_bias_potential_type(lower, "attach", 1) == "lower_walls"
759 +
760 +
    # Test lower wall restraint (3)
761 +
    lower = DAT_restraint()
762 +
    lower.auto_apr = False
763 +
    lower.amber_index = True
764 +
    lower.topology = os.path.join(os.path.dirname(__file__), "../data/k-cl/k-cl.pdb")
765 +
    lower.mask1 = "@K+"
766 +
    lower.mask2 = "@Cl-"
767 +
768 +
    lower.attach["fc_initial"] = 1.0
769 +
    lower.attach["fc_final"] = 1.0
770 +
771 +
    lower.custom_restraint_values["rk2"] = 1.0
772 +
    lower.custom_restraint_values["rk3"] = 0.0
773 +
    lower.custom_restraint_values["r2"] = 3.5
774 +
    lower.custom_restraint_values["r3"] = 6.5
775 +
776 +
    lower.attach["target"] = 3.5
777 +
    lower.attach["num_windows"] = len(attach_fractions)
778 +
779 +
    lower.initialize()
780 +
781 +
    assert get_bias_potential_type(lower, "attach", 0) == "lower_walls"
782 +
    assert get_bias_potential_type(lower, "attach", 1) == "lower_walls"

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
paprika 0.24% 77.15%
setup.py 16.08%
Project Totals (30 files) 73.97%
Loading