MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / Config

Class Config

utils/src/utils.py:314–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312
313
314class Config:
315
316 def __init__(self, rundir=None, session_id=None, debug=True):
317 self.DEBUG = debug
318 if session_id is not None:
319 self.set_session(session_id)
320 if rundir is not None:
321 self.set_rundir(rundir)
322
323 def set_session(self, session_id):
324 self.session_id = session_id
325 self.set_rundir(f"./runs/{session_id}")
326
327 def set_rundir(self, rundir: str):
328 self.RUN_DIR = rundir
329 self.IMAGE_DIR = pjoin(self.RUN_DIR, "images")
330 for the_dir in [self.RUN_DIR, self.IMAGE_DIR]:
331 os.makedirs(the_dir, exist_ok=True)
332
333 def set_debug(self, debug: bool):
334 self.DEBUG = debug
335
336 def remove_rundir(self):
337 if pexists(self.RUN_DIR):
338 shutil.rmtree(self.RUN_DIR)
339 if pexists(self.IMAGE_DIR):
340 shutil.rmtree(self.IMAGE_DIR)
341
342
343pjoin = os.path.join

Callers 11

presentation.pyFile · 0.90
ppt_validateFunction · 0.90
dataset_statFunction · 0.90
pres_scoreFunction · 0.90
eval_experimentFunction · 0.90
eval_baselineFunction · 0.90
rebuild.pyFile · 0.90
prepare_ppt_folderFunction · 0.90
do_inductFunction · 0.90
do_generateFunction · 0.90
utils.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected