Skip to content

Commit

Permalink
compare types via is
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvoegele committed Oct 4, 2023
1 parent 11e9a81 commit af7789f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pensa/preprocessing/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,17 +249,16 @@ def merge_and_sort_coordinates(values, top_names, trj_names, out_name, start_fra
Sorted indices of the trajectory.
"""
assert type(values) == list and type(
top_names) == list and type(trj_names) == list
assert type(values) is list and type(top_names) is list and type(trj_names) is list
# Get some stats
num_traj = len(values)
num_frames = [len(val) for val in values]
# Number of values must be consistent with topologies and trajectories
assert num_traj == len(top_names)
assert num_traj == len(trj_names)
# Set offset if not provided
assert type(start_frame) == int or len(start_frame) == num_traj
if type(start_frame) == int:
assert type(start_frame) is int or len(start_frame) == num_traj
if type(start_frame) is int:
start_frame *= np.ones(num_traj)
start_frame = start_frame.tolist()
# Make sure the start indices are integers (MDA does not accept floats for indexing a trajectory)
Expand Down

0 comments on commit af7789f

Please sign in to comment.