Skip to content

Commit 626a60b

Browse files
author
Charlles Abreu
authored
Improved documentation of default values (#96)
1 parent f5789f0 commit 626a60b

File tree

8 files changed

+19
-19
lines changed

8 files changed

+19
-19
lines changed

cvpack/attraction_strength.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from openmm import unit as mmunit
1414

1515
from .collective_variable import CollectiveVariable
16-
from .units import ScalarQuantity
16+
from .units import Quantity, ScalarQuantity
1717
from .utils import evaluate_in_context
1818

1919
ONE_4PI_EPS0 = 138.93545764438198
@@ -173,7 +173,7 @@ def __init__( # pylint: disable=too-many-locals
173173
group2: t.Iterable[int],
174174
nonbondedForce: openmm.NonbondedForce,
175175
contrastGroup: t.Optional[t.Iterable[int]] = None,
176-
reference: t.Union[ScalarQuantity, openmm.Context] = (
176+
reference: t.Union[ScalarQuantity, openmm.Context] = Quantity(
177177
1.0 * mmunit.kilojoule_per_mole
178178
),
179179
contrastScaling: float = 1.0,

cvpack/helix_angle_content.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from openmm import unit as mmunit
1515

1616
from .collective_variable import CollectiveVariable
17-
from .units import ScalarQuantity
17+
from .units import Quantity, ScalarQuantity
1818

1919

2020
class HelixAngleContent(openmm.CustomAngleForce, CollectiveVariable):
@@ -95,8 +95,8 @@ def __init__(
9595
self,
9696
residues: t.Sequence[mmapp.topology.Residue],
9797
pbc: bool = False,
98-
thetaReference: ScalarQuantity = 88 * mmunit.degrees,
99-
tolerance: ScalarQuantity = 15 * mmunit.degrees,
98+
thetaReference: ScalarQuantity = Quantity(88 * mmunit.degrees),
99+
tolerance: ScalarQuantity = Quantity(15 * mmunit.degrees),
100100
halfExponent: int = 3,
101101
normalize: bool = False,
102102
name: str = "helix_angle_content",

cvpack/helix_hbond_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from openmm import unit as mmunit
1616

1717
from .collective_variable import CollectiveVariable
18-
from .units import ScalarQuantity
18+
from .units import Quantity, ScalarQuantity
1919

2020

2121
class HelixHBondContent(openmm.CustomBondForce, CollectiveVariable):
@@ -83,7 +83,7 @@ def __init__(
8383
self,
8484
residues: t.Sequence[mmapp.topology.Residue],
8585
pbc: bool = False,
86-
thresholdDistance: ScalarQuantity = 0.33 * mmunit.nanometers,
86+
thresholdDistance: ScalarQuantity = Quantity(0.33 * mmunit.nanometers),
8787
halfExponent: int = 3,
8888
normalize: bool = False,
8989
name: str = "helix_hbond_content",

cvpack/helix_rmsd_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from openmm import unit as mmunit
1414

1515
from .base_rmsd_content import BaseRMSDContent
16-
from .units import ScalarQuantity
16+
from .units import Quantity, ScalarQuantity
1717

1818
# pylint: disable=protected-access
1919
ALPHA_POSITIONS = BaseRMSDContent._loadPositions("ideal_alpha_helix.csv")
@@ -131,7 +131,7 @@ def __init__(
131131
self,
132132
residues: t.Sequence[mmapp.topology.Residue],
133133
numAtoms: int,
134-
thresholdRMSD: ScalarQuantity = 0.08 * mmunit.nanometers,
134+
thresholdRMSD: ScalarQuantity = Quantity(0.08 * mmunit.nanometers),
135135
stepFunction: str = "(1+x^4)/(1+x^4+x^8)",
136136
normalize: bool = False,
137137
name: str = "helix_rmsd_content",

cvpack/helix_torsion_content.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from openmm import unit as mmunit
1515

1616
from .collective_variable import CollectiveVariable
17-
from .units import ScalarQuantity
17+
from .units import Quantity, ScalarQuantity
1818

1919

2020
class HelixTorsionContent(openmm.CustomTorsionForce, CollectiveVariable):
@@ -105,9 +105,9 @@ def __init__(
105105
self,
106106
residues: t.Sequence[mmapp.topology.Residue],
107107
pbc: bool = False,
108-
phiReference: ScalarQuantity = -63.8 * mmunit.degrees,
109-
psiReference: ScalarQuantity = -41.1 * mmunit.degrees,
110-
tolerance: ScalarQuantity = 25 * mmunit.degrees,
108+
phiReference: ScalarQuantity = Quantity(-63.8 * mmunit.degrees),
109+
psiReference: ScalarQuantity = Quantity(-41.1 * mmunit.degrees),
110+
tolerance: ScalarQuantity = Quantity(25 * mmunit.degrees),
111111
halfExponent: int = 3,
112112
normalize: bool = False,
113113
name: str = "helix_torsion_content",

cvpack/number_of_contacts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from openmm import unit as mmunit
1515

1616
from .collective_variable import CollectiveVariable
17-
from .units import ScalarQuantity
17+
from .units import Quantity, ScalarQuantity
1818
from .utils import evaluate_in_context
1919

2020

@@ -130,7 +130,7 @@ def __init__(
130130
nonbondedForce: openmm.NonbondedForce,
131131
reference: t.Union[Real, openmm.Context] = 1.0,
132132
stepFunction: str = "1/(1+x^6)",
133-
thresholdDistance: ScalarQuantity = 0.3 * mmunit.nanometers,
133+
thresholdDistance: ScalarQuantity = Quantity(0.3 * mmunit.nanometers),
134134
cutoffFactor: float = 2.0,
135135
switchFactor: t.Optional[float] = 1.5,
136136
name: str = "number_of_contacts",

cvpack/residue_coordination.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from openmm.app.topology import Residue
1616

1717
from .collective_variable import CollectiveVariable
18-
from .units import ScalarQuantity, value_in_md_units
18+
from .units import Quantity, ScalarQuantity, value_in_md_units
1919

2020

2121
class ResidueCoordination(openmm.CustomCentroidBondForce, CollectiveVariable):
@@ -111,7 +111,7 @@ def __init__(
111111
residueGroup2: t.Iterable[Residue],
112112
pbc: bool = True,
113113
stepFunction: str = "1/(1+x^6)",
114-
thresholdDistance: ScalarQuantity = 1.0 * mmunit.nanometers,
114+
thresholdDistance: ScalarQuantity = Quantity(1.0 * mmunit.nanometers),
115115
normalize: bool = False,
116116
weighByMass: bool = True,
117117
includeHydrogens: bool = True,

cvpack/sheet_rmsd_content.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from openmm import unit as mmunit
1515

1616
from .base_rmsd_content import BaseRMSDContent
17-
from .units import ScalarQuantity
17+
from .units import Quantity, ScalarQuantity
1818

1919
# pylint: disable=protected-access
2020
PARABETA_POSITIONS = BaseRMSDContent._loadPositions("ideal_parallel_beta_sheet.csv")
@@ -182,7 +182,7 @@ def __init__(
182182
numAtoms: int,
183183
parallel: bool = False,
184184
blockSizes: t.Optional[t.Sequence[int]] = None,
185-
thresholdRMSD: ScalarQuantity = 0.08 * mmunit.nanometers,
185+
thresholdRMSD: ScalarQuantity = Quantity(0.08 * mmunit.nanometers),
186186
stepFunction: str = "(1+x^4)/(1+x^4+x^8)",
187187
normalize: bool = False,
188188
name: str = "sheet_rmsd_content",

0 commit comments

Comments
 (0)