Skip to content

Commit 5fa950a

Browse files
committed
apply pre-commit hooks and linting to docs branch
1 parent 2eee3ca commit 5fa950a

2 files changed

Lines changed: 19 additions & 18 deletions

File tree

CodeEntropy/entropy.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ def __init__(
2828
universe: MDAnalysis universe representing the simulation system.
2929
data_logger: Logger for storing and exporting entropy data.
3030
level_manager: Provides level-specific data such as matrices and dihedrals.
31-
group_molecules: includes the grouping functions for averaging over molecules.
31+
group_molecules: includes the grouping functions for averaging over
32+
molecules.
3233
"""
3334
self._run_manager = run_manager
3435
self._args = args
@@ -374,9 +375,9 @@ def _process_united_atom_entropy(
374375
ve: VibrationalEntropy object.
375376
ce: ConformationalEntropy object.
376377
level (str): Granularity level (should be "united_atom").
377-
force_matrix (dict): The force covariance matrices for the united
378-
torque_matrix (dict): The torque covariance matrices for the united
379-
atom residues.
378+
force_matrix (dict): The force covariance matrices for the united
379+
torque_matrix (dict): The torque covariance matrices for the united
380+
atom residues.
380381
states (dict): The united atom conformational states
381382
highest (bool): Whether this is the highest level of resolution for
382383
the molecule.
@@ -608,7 +609,7 @@ def _calculate_water_orientational_entropy(self, Sorient_dict):
608609
Logs orientational entropy values directly from Sorient_dict.
609610
610611
Args:
611-
Sorient_dict (dict):
612+
Sorient_dict (dict):
612613
"""
613614
for resid, resname_dict in Sorient_dict.items():
614615
for resname, values in resname_dict.items():
@@ -843,7 +844,8 @@ def assign_conformation(
843844
step (int): spacing between frames, will default to 1
844845
845846
Returns:
846-
conformations (array): A timeseries with integer labels describing the state at each point in time.
847+
conformations (array): A timeseries with integer labels describing the
848+
state at each point in time.
847849
848850
"""
849851
conformations = np.zeros(number_frames)

CodeEntropy/levels.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def select_levels(self, data_container):
3535
that will be used in the entropy calculations.
3636
3737
Args:
38-
arg_DataContainer: MDAnalysis universe object containing the system of interest
38+
arg_DataContainer: MDAnalysis universe object containing the system of
39+
interest
3940
4041
Returns:
4142
number_molecules (int): Number of molecules in the system.
@@ -84,7 +85,8 @@ def get_matrices(
8485
level (str): 'polymer', 'residue', or 'united_atom'.
8586
number_frames (int): Number of frames being processed.
8687
highest_level (bool): Whether this is the top (largest bead size) level.
87-
force_matrix, torque_matrix (np.ndarray or None): Accumulated matrices to add to.
88+
force_matrix, torque_matrix (np.ndarray or None): Accumulated matrices to add
89+
to.
8890
8991
Returns:
9092
force_matrix (np.ndarray): Accumulated force covariance matrix.
@@ -126,12 +128,8 @@ def get_matrices(
126128

127129
for i in range(number_beads):
128130
for j in range(i, number_beads):
129-
f_sub = self.create_submatrix(
130-
weighted_forces[i], weighted_forces[j]
131-
)
132-
t_sub = self.create_submatrix(
133-
weighted_torques[i], weighted_torques[j]
134-
)
131+
f_sub = self.create_submatrix(weighted_forces[i], weighted_forces[j])
132+
t_sub = self.create_submatrix(weighted_torques[i], weighted_torques[j])
135133
force_submatrix[i][j] = f_sub
136134
force_submatrix[j][i] = f_sub.T
137135
torque_submatrix[i][j] = t_sub
@@ -330,7 +328,7 @@ def get_beads(self, data_container, level):
330328
atom_group = "resindex " + str(residue)
331329
list_of_beads.append(data_container.select_atoms(atom_group))
332330

333-
#NOTE this could cause problems for hydrogen or helium molecules
331+
# NOTE this could cause problems for hydrogen or helium molecules
334332
if level == "united_atom":
335333
list_of_beads = []
336334
heavy_atoms = data_container.select_atoms("not name H*")
@@ -570,11 +568,12 @@ def get_weighted_forces(
570568
bead : The part of the molecule to be considered.
571569
trans_axes (np.ndarray): The axes relative to which the forces are located.
572570
highest_level (bool): Is this the largest level of the length scale hierarchy
573-
force_partitioning (float): Factor to adjust force contributions to avoid over
574-
counting correlated forces, default is 0.5.
571+
force_partitioning (float): Factor to adjust force contributions to avoid
572+
over counting correlated forces, default is 0.5.
575573
576574
Returns:
577-
weighted_force (np.ndarray): The mass-weighted sum of the forces in the bead.
575+
weighted_force (np.ndarray): The mass-weighted sum of the forces in the
576+
bead.
578577
"""
579578

580579
forces_trans = np.zeros((3,))

0 commit comments

Comments
 (0)