Skip to content

Commit

Permalink
Improved documentation of default values (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charlles Abreu authored Apr 20, 2024
1 parent f5789f0 commit 626a60b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions cvpack/attraction_strength.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from openmm import unit as mmunit

from .collective_variable import CollectiveVariable
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity
from .utils import evaluate_in_context

ONE_4PI_EPS0 = 138.93545764438198
Expand Down Expand Up @@ -173,7 +173,7 @@ def __init__( # pylint: disable=too-many-locals
group2: t.Iterable[int],
nonbondedForce: openmm.NonbondedForce,
contrastGroup: t.Optional[t.Iterable[int]] = None,
reference: t.Union[ScalarQuantity, openmm.Context] = (
reference: t.Union[ScalarQuantity, openmm.Context] = Quantity(
1.0 * mmunit.kilojoule_per_mole
),
contrastScaling: float = 1.0,
Expand Down
6 changes: 3 additions & 3 deletions cvpack/helix_angle_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from openmm import unit as mmunit

from .collective_variable import CollectiveVariable
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity


class HelixAngleContent(openmm.CustomAngleForce, CollectiveVariable):
Expand Down Expand Up @@ -95,8 +95,8 @@ def __init__(
self,
residues: t.Sequence[mmapp.topology.Residue],
pbc: bool = False,
thetaReference: ScalarQuantity = 88 * mmunit.degrees,
tolerance: ScalarQuantity = 15 * mmunit.degrees,
thetaReference: ScalarQuantity = Quantity(88 * mmunit.degrees),
tolerance: ScalarQuantity = Quantity(15 * mmunit.degrees),
halfExponent: int = 3,
normalize: bool = False,
name: str = "helix_angle_content",
Expand Down
4 changes: 2 additions & 2 deletions cvpack/helix_hbond_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from openmm import unit as mmunit

from .collective_variable import CollectiveVariable
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity


class HelixHBondContent(openmm.CustomBondForce, CollectiveVariable):
Expand Down Expand Up @@ -83,7 +83,7 @@ def __init__(
self,
residues: t.Sequence[mmapp.topology.Residue],
pbc: bool = False,
thresholdDistance: ScalarQuantity = 0.33 * mmunit.nanometers,
thresholdDistance: ScalarQuantity = Quantity(0.33 * mmunit.nanometers),
halfExponent: int = 3,
normalize: bool = False,
name: str = "helix_hbond_content",
Expand Down
4 changes: 2 additions & 2 deletions cvpack/helix_rmsd_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from openmm import unit as mmunit

from .base_rmsd_content import BaseRMSDContent
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity

# pylint: disable=protected-access
ALPHA_POSITIONS = BaseRMSDContent._loadPositions("ideal_alpha_helix.csv")
Expand Down Expand Up @@ -131,7 +131,7 @@ def __init__(
self,
residues: t.Sequence[mmapp.topology.Residue],
numAtoms: int,
thresholdRMSD: ScalarQuantity = 0.08 * mmunit.nanometers,
thresholdRMSD: ScalarQuantity = Quantity(0.08 * mmunit.nanometers),
stepFunction: str = "(1+x^4)/(1+x^4+x^8)",
normalize: bool = False,
name: str = "helix_rmsd_content",
Expand Down
8 changes: 4 additions & 4 deletions cvpack/helix_torsion_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from openmm import unit as mmunit

from .collective_variable import CollectiveVariable
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity


class HelixTorsionContent(openmm.CustomTorsionForce, CollectiveVariable):
Expand Down Expand Up @@ -105,9 +105,9 @@ def __init__(
self,
residues: t.Sequence[mmapp.topology.Residue],
pbc: bool = False,
phiReference: ScalarQuantity = -63.8 * mmunit.degrees,
psiReference: ScalarQuantity = -41.1 * mmunit.degrees,
tolerance: ScalarQuantity = 25 * mmunit.degrees,
phiReference: ScalarQuantity = Quantity(-63.8 * mmunit.degrees),
psiReference: ScalarQuantity = Quantity(-41.1 * mmunit.degrees),
tolerance: ScalarQuantity = Quantity(25 * mmunit.degrees),
halfExponent: int = 3,
normalize: bool = False,
name: str = "helix_torsion_content",
Expand Down
4 changes: 2 additions & 2 deletions cvpack/number_of_contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from openmm import unit as mmunit

from .collective_variable import CollectiveVariable
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity
from .utils import evaluate_in_context


Expand Down Expand Up @@ -130,7 +130,7 @@ def __init__(
nonbondedForce: openmm.NonbondedForce,
reference: t.Union[Real, openmm.Context] = 1.0,
stepFunction: str = "1/(1+x^6)",
thresholdDistance: ScalarQuantity = 0.3 * mmunit.nanometers,
thresholdDistance: ScalarQuantity = Quantity(0.3 * mmunit.nanometers),
cutoffFactor: float = 2.0,
switchFactor: t.Optional[float] = 1.5,
name: str = "number_of_contacts",
Expand Down
4 changes: 2 additions & 2 deletions cvpack/residue_coordination.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from openmm.app.topology import Residue

from .collective_variable import CollectiveVariable
from .units import ScalarQuantity, value_in_md_units
from .units import Quantity, ScalarQuantity, value_in_md_units


class ResidueCoordination(openmm.CustomCentroidBondForce, CollectiveVariable):
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(
residueGroup2: t.Iterable[Residue],
pbc: bool = True,
stepFunction: str = "1/(1+x^6)",
thresholdDistance: ScalarQuantity = 1.0 * mmunit.nanometers,
thresholdDistance: ScalarQuantity = Quantity(1.0 * mmunit.nanometers),
normalize: bool = False,
weighByMass: bool = True,
includeHydrogens: bool = True,
Expand Down
4 changes: 2 additions & 2 deletions cvpack/sheet_rmsd_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from openmm import unit as mmunit

from .base_rmsd_content import BaseRMSDContent
from .units import ScalarQuantity
from .units import Quantity, ScalarQuantity

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

0 comments on commit 626a60b

Please sign in to comment.