Skip to content

Commit

Permalink
edit ruff errors in nbs
Browse files Browse the repository at this point in the history
  • Loading branch information
qcampbel committed Feb 22, 2025
1 parent a024bd0 commit c4648c8
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"outputs": [],
"source": [
"from mdcrow import MDCrow\n",
"import os \n",
"import mdtraj as md"
"import os "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"outputs": [],
"source": [
"from mdcrow import MDCrow\n",
"import os \n",
"import mdtraj as md"
"import os "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"outputs": [],
"source": [
"from mdcrow import MDCrow\n",
"import os \n",
"import mdtraj as md"
"import os "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"outputs": [],
"source": [
"from mdcrow import MDCrow\n",
"import os \n",
"import mdtraj as md"
"import os "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"source": [
"import re\n",
"import os\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down Expand Up @@ -251,7 +251,7 @@
"source": [
"import re\n",
"import os\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"import os\n",
"import re\n",
"\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down Expand Up @@ -327,7 +327,7 @@
"import os\n",
"import re\n",
"\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8731,7 +8731,7 @@
],
"source": [
"from IPython.display import Image\n",
"match = re.search(rf\"fig0_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"fig0_\\d+\", paths_and_descriptions)\n",
"fig_id = match.group(0)\n",
"fig_path = registry.get_mapped_path(fig_id)\n",
"assert os.path.exists(fig_path), \"This figure does not exist.\"\n",
Expand Down Expand Up @@ -16760,7 +16760,7 @@
],
"source": [
"from IPython.display import Image\n",
"match = re.search(rf\"fig0_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"fig0_\\d+\", paths_and_descriptions)\n",
"fig_id = match.group(0)\n",
"fig_path = registry.get_mapped_path(fig_id)\n",
"assert os.path.exists(fig_path), \"This figure does not exist.\"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"source": [
"import re\n",
"import os\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down Expand Up @@ -255,7 +255,7 @@
"source": [
"import re\n",
"import os\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"import os\n",
"import re\n",
"\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down Expand Up @@ -338,7 +338,7 @@
"import os\n",
"import re\n",
"\n",
"match = re.search(rf\"1LYZ_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"1LYZ_\\d+\", paths_and_descriptions)\n",
"file_id = match.group(0)\n",
"pdb_path = registry.get_mapped_path(file_id)\n",
"assert os.path.exists(pdb_path)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8825,7 +8825,7 @@
],
"source": [
"from IPython.display import Image\n",
"match = re.search(rf\"fig0_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"fig0_\\d+\", paths_and_descriptions)\n",
"fig_id = match.group(0)\n",
"fig_path = registry.get_mapped_path(fig_id)\n",
"assert os.path.exists(fig_path), \"This figure does not exist.\"\n",
Expand Down Expand Up @@ -16984,7 +16984,7 @@
],
"source": [
"from IPython.display import Image\n",
"match = re.search(rf\"fig0_\\d+\", paths_and_descriptions)\n",
"match = re.search(r\"fig0_\\d+\", paths_and_descriptions)\n",
"fig_id = match.group(0)\n",
"fig_path = registry.get_mapped_path(fig_id)\n",
"assert os.path.exists(fig_path), \"This figure does not exist.\"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -114,12 +114,12 @@
}
],
"source": [
"import mdtraj as md\n",
"trajectory_path = registry.ckpt_dir + registry.get_mapped_path(\"rec0_114115\").split(\"ckpt_66\")[1]\n",
"topology_path = registry.ckpt_dir + registry.get_mapped_path(\"top_sim0_114113\").split(\"ckpt_66\")[1]\n",
"assert os.path.exists(trajectory_path), \"Trajectory file not found\"\n",
"assert os.path.exists(topology_path), \"Topology file not found\"\n",
"\n",
"import mdtraj as md\n",
"traj = md.load(trajectory_path, top=topology_path)\n",
"print(f\"Simulation with :{traj.n_atoms} for {traj.n_frames} frames.\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -238,12 +238,13 @@
}
],
"source": [
"import mdtraj as md\n",
"\n",
"trajectory_path = registry.get_mapped_path(\"rec0_215117\")\n",
"topology_path = registry.get_mapped_path(\"top_sim0_215114\")\n",
"assert os.path.exists(trajectory_path), \"Trajectory file not found\"\n",
"assert os.path.exists(topology_path), \"Topology file not found\"\n",
"\n",
"import mdtraj as md\n",
"traj = md.load(trajectory_path, top=topology_path)\n",
"print(f\"Simulation with :{traj.n_atoms} for {traj.n_frames} frames. Total time: {traj.time[-1]*0.002} ps\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -339,7 +339,7 @@
],
"source": [
"from IPython.display import Image\n",
"Image(filename=path_oxygenated)"
"Image(filename=path_oxygenated) # noqa: F821 - ignore this ruff error"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "4b9220de-6a3c-4db9-8768-68298ece63a6",
"metadata": {},
"outputs": [
Expand All @@ -196,10 +196,11 @@
}
],
"source": [
"from IPython.display import Image\n",
"\n",
"rmsd_path_ = registry.get_mapped_path(\"fig0_043015\")\n",
"path = '/Users/jorgemedina/Desktop/md-agent/ckpt/ckpt_29' + rmsd_path_.split(\"ckpt/ckpt_29\")[1]\n",
"print(path)\n",
"from IPython.display import Image\n",
"Image(path)"
]
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "b0fcba3a",
"metadata": {},
"outputs": [],
"source": [
"import time \n",
"# time.sleep(4000)"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "21b81076",
"metadata": {},
"outputs": [
Expand All @@ -212,6 +212,8 @@
}
],
"source": [
"from IPython.display import Image\n",
"\n",
"path1_ = registry.get_mapped_path(\"fig0_180235\")\n",
"path2_ = registry.get_mapped_path(\"fig0_180233\")\n",
"path3_ = registry.get_mapped_path(\"fig0_180237\")\n",
Expand All @@ -222,7 +224,6 @@
"path_3 = '/Users/jorgemedina/Desktop/md-agent/ckpt/ckpt_32' + path3_.split(\"ckpt/ckpt_32\")[1]\n",
"path_4 = '/Users/jorgemedina/Desktop/md-agent/ckpt/ckpt_32' + path4_.split(\"ckpt/ckpt_32\")[1]\n",
"\n",
"from IPython.display import Image\n",
"Image(filename=path_1)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -431,8 +431,8 @@
}
],
"source": [
"path_ = registry.get_mapped_path(\"fig0_162840\") + '.png'\n",
"from IPython.display import Image\n",
"path_ = registry.get_mapped_path(\"fig0_162840\") + '.png'\n",
"Image(filename=path_)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -112,12 +112,13 @@
}
],
"source": [
"import mdtraj as md\n",
"\n",
"trajectory_path = registry.ckpt_dir + registry.get_mapped_path(\"rec0_111845\").split(\"ckpt_41\")[1]\n",
"topology_path = registry.ckpt_dir + registry.get_mapped_path(\"top_sim0_111844\").split(\"ckpt_41\")[1]\n",
"assert os.path.exists(trajectory_path), \"Trajectory file not found\"\n",
"assert os.path.exists(topology_path), \"Topology file not found\"\n",
"\n",
"import mdtraj as md\n",
"traj = md.load(trajectory_path, top=topology_path)\n",
"print(f\"Simulation with :{traj.n_atoms} for {traj.n_frames} frames.\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -177,9 +177,9 @@
}
],
"source": [
"from IPython.display import Image\n",
"rdf_path = registry.get_mapped_path(\"fig0_113444\")\n",
"rdf_path = '/Users/jorgemedina/Desktop/md-agent/ckpt/ckpt_42' + rdf_path.split(\"ckpt/ckpt_42\")[1]\n",
"from IPython.display import Image\n",
"Image(filename=rdf_path)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -145,14 +145,15 @@
}
],
"source": [
"import mdtraj as md\n",
"\n",
"trajectory_path = registry.get_mapped_path(\"rec0_104757\")\n",
"topology_path = registry.get_mapped_path(\"top_sim0_104753\")\n",
"trajectory_path = '/Users/jorgemedina/Desktop/md-agent/ckpt/ckpt_44' + trajectory_path.split('ckpt/ckpt_44')[1]\n",
"topology_path = '/Users/jorgemedina/Desktop/md-agent/ckpt/ckpt_44' + topology_path.split('ckpt/ckpt_44')[1]\n",
"assert os.path.exists(trajectory_path), \"Trajectory file not found\"\n",
"assert os.path.exists(topology_path), \"Topology file not found\"\n",
"\n",
"import mdtraj as md\n",
"traj = md.load(trajectory_path, top=topology_path)\n",
"print(f\"Simulation with :{traj.n_atoms} for {traj.n_frames} frames.\")"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -447,6 +447,7 @@
}
],
"source": [
"from IPython.display import Image\n",
"Image(filename=path1)"
]
},
Expand Down
Loading

0 comments on commit c4648c8

Please sign in to comment.