Skip to content

Commit 299a0cd

Browse files
authored
Merge pull request #161 from dessn/tmp
add REFACTORED and LEGACY options to scone for debugging refactor
2 parents 6124222 + 8ec7458 commit 299a0cd

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

pippin/classifiers/scone.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,19 @@ def classify(self, mode):
173173

174174
slurm_script = self.make_model_sbatch_script()
175175

176-
self.logger.info(f"Submitting batch job {self.model_sbatch_job_path}")
177-
178176
# TODO: nersc needs `module load esslurm` to sbatch gpu jobs, maybe make
179177
# this shell command to a file so diff systems can define their own
180-
subprocess.run([f"python {Path(self.path_to_classifier) / 'run.py'} --config_path {self.config_path}"], shell=True)
178+
file_to_run = 'run.py'
179+
if self.options.get("REFACTORED", False):
180+
file_to_run = 'run_refactor.py'
181+
elif self.options.get("LEGACY", False):
182+
file_to_run = 'run_legacy.py'
183+
path = Path(self.path_to_classifier) / file_to_run
184+
path = path if path.exists() else Path(self.path_to_classifier) / 'run.py'
185+
cmd = f"python {str(path)} --config_path {self.config_path}"
186+
subprocess.run([cmd], shell=True)
187+
self.logger.info(f"Running command: {cmd}")
188+
181189
return True
182190

183191
def predict(self):

0 commit comments

Comments
 (0)