Skip to content

Commit fecd7b8

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8ccf101 commit fecd7b8

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

mbuild/path/bias.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def __init__(self, site_type, weight, system_coordinates, new_coordinates):
5858
super(TargetType, self).__init__(system_coordinates, new_coordinates)
5959

6060
def __call__(self):
61-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
61+
raise NotImplementedError(
62+
"This feature of mBuild 2.0 has not been implemented yet."
63+
)
6264

6365

6466
class AvoidType(Bias):
@@ -69,7 +71,9 @@ def __init__(self, site_type, weight, system_coordinates, new_coordinates):
6971
super(AvoidType, self).__init__(system_coordinates, new_coordinates)
7072

7173
def __call__(self):
72-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
74+
raise NotImplementedError(
75+
"This feature of mBuild 2.0 has not been implemented yet."
76+
)
7377

7478

7579
class TargetEdge(Bias):
@@ -80,7 +84,9 @@ def __init__(self, weight, system_coordinates, volume_constraint, new_coordinate
8084
super(TargetEdge, self).__init__(system_coordinates, new_coordinates)
8185

8286
def __call__(self):
83-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
87+
raise NotImplementedError(
88+
"This feature of mBuild 2.0 has not been implemented yet."
89+
)
8490

8591

8692
class AvoidEdge(Bias):
@@ -91,7 +97,9 @@ def __init__(self, weight, system_coordinates, volume_constraint, new_coordinate
9197
super(AvoidEdge, self).__init__(system_coordinates, new_coordinates)
9298

9399
def __call__(self):
94-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
100+
raise NotImplementedError(
101+
"This feature of mBuild 2.0 has not been implemented yet."
102+
)
95103

96104

97105
class TargetDirection(Bias):
@@ -102,7 +110,9 @@ def __init__(self, direction, weight, system_coordinates, new_coordinates):
102110
super(TargetDirection, self).__init__(system_coordinates, new_coordinates)
103111

104112
def __call__(self):
105-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
113+
raise NotImplementedError(
114+
"This feature of mBuild 2.0 has not been implemented yet."
115+
)
106116

107117

108118
class AvoidDirection(Bias):
@@ -113,7 +123,9 @@ def __init__(self, direction, weight, system_coordinates, new_coordinates):
113123
super(AvoidDirection, self).__init__(system_coordinates, new_coordinates)
114124

115125
def __call__(self):
116-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
126+
raise NotImplementedError(
127+
"This feature of mBuild 2.0 has not been implemented yet."
128+
)
117129

118130

119131
class TargetPath(Bias):
@@ -124,4 +136,6 @@ def __init__(self, target_path, weight, system_coordinates, new_coordinates):
124136
super(TargetPath, self).__init__(system_coordinates, new_coordinates)
125137

126138
def __call__(self):
127-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
139+
raise NotImplementedError(
140+
"This feature of mBuild 2.0 has not been implemented yet."
141+
)

mbuild/path/path.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ class Path:
2424
coordinates : array-like, optional
2525
Creates a path from a pre-defined set of coordinates
2626
bond_graph : networkx.Graph, optional
27-
The graph defining the edges between coordinates
27+
The graph defining the edges between coordinates
2828
"""
29+
2930
def __init__(self, N=None, coordinates=None, bond_graph=None):
3031
self.bond_graph = bond_graph
3132
# Only N is defined, make empty coordinates array with size N
@@ -80,10 +81,12 @@ def add_edge(self, u, v):
8081
length=float(bond_length),
8182
bond_type=(u_name, v_name),
8283
)
83-
84+
8485
def get_bonded_sites(self):
8586
"""Get all bonded pairs and their bond-vector orientations."""
86-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
87+
raise NotImplementedError(
88+
"This feature of mBuild 2.0 has not been implemented yet."
89+
)
8790

8891
def get_coordinates(self):
8992
if isinstance(self.coordinates, list):
@@ -122,7 +125,9 @@ def apply_mapping(self):
122125
set orientation and separation for site v tail port
123126
124127
"""
125-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
128+
raise NotImplementedError(
129+
"This feature of mBuild 2.0 has not been implemented yet."
130+
)
126131

127132
def _path_history(self):
128133
"""Maybe this is a method that can be used optionally.
@@ -131,7 +136,9 @@ def _path_history(self):
131136
computation time and resources.
132137
Might be useful for more complicated random walks/branching algorithms
133138
"""
134-
raise NotImplementedError("This feature of mBuild 2.0 has not been implemented yet.")
139+
raise NotImplementedError(
140+
"This feature of mBuild 2.0 has not been implemented yet."
141+
)
135142

136143

137144
class HardSphereRandomWalk(Path):
@@ -182,7 +189,7 @@ def __init__(
182189
This path's sites are used in checking for overlapping sites.
183190
start_from_path_index : int, optional
184191
An index of `start_from_path` used as the starting point for this random walk.
185-
attach_paths : bool, default = False
192+
attach_paths : bool, default = False
186193
If True, adds an edge between the starting point of the last path and the first
187194
point of this path.
188195
initial_point : array-like, optional
@@ -807,14 +814,15 @@ class ZigZag(Path):
807814
The distance between consecutive sites along the path.
808815
angle_deg : float, default = 120.
809816
The rotation applied between segments
810-
sites_per_segment : int, default = 4
817+
sites_per_segment : int, default = 4
811818
The number of sites before rotating and beginning next segment.
812819
plane : str, default = "xy"
813820
The plane that the sites in the path occupy
814821
bond_graph : networkx.Graph
815822
Defines connectivity between sites
816823
817824
"""
825+
818826
def __init__(
819827
self,
820828
N,

mbuild/utils/volumes.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ class Constraint:
1010
Notes
1111
-----
1212
Design and implement your own volume constraint by inheriting from this class
13-
and implementing the constraint check in an `is_inside` method.
13+
and implementing the constraint check in an `is_inside` method.
1414
1515
`is_inside` is expected to return a mask of booleans.
1616
1717
The existing contraints of CuboidConstraint, SphereConstraint, and CylinderConstraint
1818
call numba methods from their respectice `is_inside` method, but that is not a required
1919
implementation to design your own constraint.
2020
"""
21+
2122
def __init__(self):
2223
pass
2324

@@ -40,6 +41,7 @@ class CuboidConstraint(Constraint):
4041
center : array-like (1,3), default = (0, 0, 0)
4142
Defines the center of the volume.
4243
"""
44+
4345
def __init__(self, Lx, Ly, Lz, center=(0, 0, 0)):
4446
self.center = np.asarray(center)
4547
self.mins = self.center - np.array([Lx / 2, Ly / 2, Lz / 2])
@@ -74,6 +76,7 @@ class SphereConstraint(Constraint):
7476
center : array-like (1,3), default = (0, 0, 0)
7577
Defines the center point of the sphere.
7678
"""
79+
7780
def __init__(self, center, radius):
7881
self.center = np.array(center)
7982
self.radius = radius
@@ -109,6 +112,7 @@ class CylinderConstraint(Constraint):
109112
center : array-like (1,3), default = (0, 0, 0)
110113
Defines the center point of the sphere.
111114
"""
115+
112116
def __init__(self, radius, height, center=(0, 0, 0)):
113117
self.center = np.array(center)
114118
self.height = height

0 commit comments

Comments
 (0)