Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: revert @property decorator for project/job dir #85

Merged
merged 2 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cryosparc/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def refresh(self):
self._doc = self.cs.cli.get_job(self.project_uid, self.uid) # type: ignore
return self

@property
def dir(self) -> PurePosixPath:
"""
Get the path to the job directory.
Expand Down
1 change: 0 additions & 1 deletion cryosparc/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def refresh(self):
self._doc = self.cs.cli.get_project(self.uid) # type: ignore
return self

@property
def dir(self) -> PurePosixPath:
"""
Get the path to the project directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/connect_series_to_class3D.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"desired_volume_series = 0\n",
"\n",
"series_path = var3Ddisp_job.load_output(f\"series_{desired_volume_series}\")[\"series/path\"][0]\n",
"series_path = str(project.dir / series_path)"
"series_path = str(project.dir() / series_path)"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/cryolo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
" \"--train_image_folder train_image \"\n",
" \"--train_annot_folder train_annot\"\n",
" ).split(\" \"),\n",
" cwd=job.dir,\n",
" cwd=job.dir(),\n",
")"
]
},
Expand All @@ -337,7 +337,7 @@
"source": [
"job.subprocess(\n",
" \"cryolo_train.py -c config_cryolo.json -w 5 -g 0 -e 15\".split(\" \"),\n",
" cwd=job.dir,\n",
" cwd=job.dir(),\n",
" mute=True,\n",
" checkpoint=True,\n",
" checkpoint_line_pattern=r\"Epoch \\d+/\\d+\", # e.g., \"Epoch 42/200\"\n",
Expand All @@ -364,7 +364,7 @@
"job.mkdir(\"boxfiles\")\n",
"job.subprocess(\n",
" \"cryolo_predict.py -c config_cryolo.json -w cryolo_model.h5 -i full_data -g 0 -o boxfiles -t 0.3\".split(\" \"),\n",
" cwd=job.dir,\n",
" cwd=job.dir(),\n",
" mute=True,\n",
" checkpoint=True,\n",
")"
Expand Down Expand Up @@ -395,7 +395,7 @@
"\n",
" starfile_name = micrograph_name.rsplit(\".\", 1)[0] + \".star\"\n",
" starfile_path = \"boxfiles/STAR/\" + starfile_name\n",
" locations = star.read(job.dir / starfile_path)[\"\"]\n",
" locations = star.read(job.dir() / starfile_path)[\"\"]\n",
" center_x = locations[\"rlnCoordinateX\"] / width\n",
" center_y = locations[\"rlnCoordinateY\"] / height\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/delete-rejected-exposures.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"from pathlib import Path\n",
"\n",
"project = cs.find_project(\"P251\")\n",
"project_dir = Path(project.dir)"
"project_dir = Path(project.dir())"
]
},
{
Expand Down