Skip to content

Commit

Permalink
Blacked
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicanyelles committed Nov 23, 2022
1 parent 4b2c11f commit 0520627
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
17 changes: 8 additions & 9 deletions RCBS/md_analyser/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,13 @@ def add_RMSD(self, name, sel, ref=None, superposition=True):
elif isinstance(ref, AtomGroup):
ref = ref.positions - ref.center_of_mass()


self.measurements.append(
{
"name": name,
"type": "rmsd",
"sel": sel,
"ref": ref,
"options": {
"superposition" : superposition
},
"options": {"superposition": superposition},
}
)

Expand Down Expand Up @@ -725,22 +722,24 @@ def run_measure(self, save_output=False, verbose=True):

self.results[measurement["name"]].append(
rms.rmsd(
measurement["sel"].positions - measurement["sel"].center_of_mass(),
measurement["sel"].positions
- measurement["sel"].center_of_mass(),
measurement["ref"],
center=True, superposition=True
center=True,
superposition=True,
)
)

elif measurement["options"]["superposition"] == False:

self.results[measurement["name"]].append(
rms.rmsd(
measurement["sel"].positions - measurement["sel"].center_of_mass(),
measurement["ref"]
measurement["sel"].positions
- measurement["sel"].center_of_mass(),
measurement["ref"],
)
)


if save_output != False:

if save_output.split(".")[-1] in ("json", "jsn"):
Expand Down
3 changes: 1 addition & 2 deletions RCBS/md_analyser/selections.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def selection(u, sel_input, sel_type=None, return_atomic_sel_string=False):
- MDAnalysis selection as AtomGroup
"""

if sel_type == None or sel_type.lower() in ('none', 'pipe'):
if sel_type == None or sel_type.lower() in ("none", "pipe"):
sel_string = sel_input

elif isinstance(sel_input, list):
Expand Down Expand Up @@ -70,7 +70,6 @@ def selection(u, sel_input, sel_type=None, return_atomic_sel_string=False):
elif sel_type.lower() == "res_name":
sel_string = " ".join(["resname", str(sel_input)])


if return_atomic_sel_string == False:
return u.select_atoms(sel_string)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="RCBS.py",
version='0.1.0b',
version="0.1.0",
description="Python package useful for analysing MD trajectories and creating QMMM models built on top of MDAnalysis.",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 0520627

Please sign in to comment.