Skip to content

Commit

Permalink
remove the output folder flag for templates
Browse files Browse the repository at this point in the history
  • Loading branch information
jteijema committed Nov 8, 2024
1 parent 80e0c88 commit 94e2024
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 34 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ The basic template prepares a script for conducting a simulation study with one
optional arguments:

```console
-h, --help show this help message and exit
--job_file JOB_FILE, -f JOB_FILE The name of the file with jobs. Default jobs.bat for Windows, otherwise jobs.sh.
-s DATA_FOLDER Dataset folder
-o OUTPUT_FOLDER Output folder
--init_seed INIT_SEED Seed of the priors. Seed is set to 535 by default.
--model_seed MODEL_SEED Seed of the models. Seed is set to 165 by default.
--template TEMPLATE Overwrite template with template file path.
-h, --help Show this help message and exit
-p, --project_folder PROJECT_FOLDER The folder the project will be rendered too Default: The current working directory
-s, --source DATA_FOLDER The dataset source folder Default: `Data` folder in working directory
-f, --job_file JOB_FILE The name of the file with jobs Default: jobs.bat for Windows, otherwise jobs.sh.
--init_seed INIT_SEED Seed of the priors Seed is set to 535 by default.
--model_seed MODEL_SEED Seed of the models Seed is set to 165 by default.
--template TEMPLATE Overwrite template with template file path
--platform PLATFORM Platform to run jobs: Windows, Darwin, Linux. Default: the system of rendering templates.
--n_runs N_RUNS Number of runs. Default: 1.
--skip_wordclouds Disables the generation of wordclouds.
Expand All @@ -156,10 +156,10 @@ The ARFI template (All relevant, fixed irrelevant) prepares a script for running
optional arguments:

```console
-h, --help show this help message and exit
--job_file JOB_FILE, -f JOB_FILE The name of the file with jobs. Default jobs.bat for Windows, otherwise jobs.sh.
-s DATA_FOLDER Dataset folder
-o OUTPUT_FOLDER Output folder
-h, --help Show this help message and exit
-p, --project_folder PROJECT_FOLDER The folder the project will be rendered too Default: The current working directory
-s, --source DATA_FOLDER The dataset source folder Default: `Data` folder in working directory
-f, --job_file JOB_FILE The name of the file with jobs Default: jobs.bat for Windows, otherwise jobs.sh.
--init_seed INIT_SEED Seed of the priors. Seed is set to 535 by default.
--model_seed MODEL_SEED Seed of the models. Seed is set to 165 by default.
--template TEMPLATE Overwrite template with template file path.
Expand All @@ -184,10 +184,10 @@ The multiple model template prepares a script for running a simulation study com
optional arguments:

```console
-h, --help show this help message and exit
--job_file JOB_FILE, -f JOB_FILE The name of the file with jobs. Default jobs.bat for Windows, otherwise jobs.sh.
-s DATA_FOLDER Dataset folder
-o OUTPUT_FOLDER Output folder
-h, --help Show this help message and exit
-p, --project_folder PROJECT_FOLDER The folder the project will be rendered too Default: The current working directory
-s, --source DATA_FOLDER The dataset source folder Default: `Data` folder in working directory
-f, --job_file JOB_FILE The name of the file with jobs Default: jobs.bat for Windows, otherwise jobs.sh.
--init_seed INIT_SEED Seed of the priors. Seed is set to 535 by default.
--model_seed MODEL_SEED Seed of the models. Seed is set to 165 by default.
--template TEMPLATE Overwrite template with template file path.
Expand Down Expand Up @@ -229,10 +229,10 @@ Running this template creates a `generated_data` folder. This folder contains tw
optional arguments:

```console
-h, --help show this help message and exit
--job_file JOB_FILE, -f JOB_FILE The name of the file with jobs. Default jobs.bat for Windows, otherwise jobs.sh.
-s DATA_FOLDER Dataset folder
-o OUTPUT_FOLDER Output folder
-h, --help Show this help message and exit
-p, --project_folder PROJECT_FOLDER The folder the project will be rendered too Default: The current working directory
-s, --source DATA_FOLDER The dataset source folder Default: `Data` folder in working directory
-f, --job_file JOB_FILE The name of the file with jobs Default: jobs.bat for Windows, otherwise jobs.sh.
--init_seed INIT_SEED Seed of the priors. Seed is set to 535 by default.
--model_seed MODEL_SEED Seed of the models. Seed is set to 165 by default.
--template TEMPLATE Overwrite template with template file path.
Expand Down
27 changes: 12 additions & 15 deletions asreviewcontrib/makita/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ def execute(self, argv): # noqa: C901
"jobs.bat for Windows, otherwise jobs.sh.",
)
parser_template.add_argument(
"-s", type=str, default="data", help="Dataset source folder."
"--source","-s", type=str, default="data", help="Dataset source folder."
"If not set, will use the `data` folder in the current directory as source."
)
parser_template.add_argument(
"-o", type=str, default="output", help="Output folder name."
"--project_folder",
"-p",
type=str,
help="Set project folder path."
"If not set, will use current directory."
)
parser_template.add_argument(
"--init_seed",
Expand All @@ -61,13 +65,6 @@ def execute(self, argv): # noqa: C901
parser_template.add_argument(
"--template", type=str, help="Overwrite template with template file path."
)
parser_template.add_argument(
"--project_folder",
"-p",
type=str,
help="Set project folder path."
"If not set, will use current directory."
)
parser_template.add_argument(
"--platform",
type=str,
Expand Down Expand Up @@ -162,7 +159,7 @@ def execute(self, argv): # noqa: C901
"--all", "-a", action="store_true", help="Add all scripts."
)
parser_script.add_argument(
"-o",
"--output","-o",
type=str,
default="scripts",
help="Location of the scripts folder.",
Expand Down Expand Up @@ -201,7 +198,7 @@ def _template(self, args):
print(f"\033[33mRendering template {template_name}.\u001b[0m\n")

# get dataset source folder and load data
dataset_source = Path(args.s)
dataset_source = Path(args.source)
datasets = (
list(dataset_source.glob("*.csv"))
+ list(dataset_source.glob("*.ris"))
Expand All @@ -222,13 +219,13 @@ def _template(self, args):
# If a project dir is set, use that. Else use current dir.
if args.project_folder:
project_folder = Path(args.project_folder)
output_folder = project_folder / Path(args.o)
output_folder = project_folder / Path('output')
data_folder = project_folder / Path('data')
scripts_folder = project_folder / Path('scripts')
job_file_path = project_folder / Path(args.job_file)
else:
project_folder = args.project_folder
output_folder = Path(args.o)
output_folder = Path('output')
data_folder = Path('data')
scripts_folder = Path('scripts')
job_file_path = Path(args.job_file)
Expand Down Expand Up @@ -275,7 +272,7 @@ def _template(self, args):
datasets=datasets,
fp_template=fp_template,
project_folder=project_folder,
output_folder=Path(args.o),
output_folder=Path('output'),
scripts_folder=Path('scripts'),
job_file=job_file_path,
**{key: vars(args)[key] for key in keys_of_interest if key in vars(args)},
Expand Down Expand Up @@ -317,6 +314,6 @@ def _add_script(self, args):
)

# export script
export_fp = Path(args.o, script)
export_fp = Path(args.output, script)
self.file_handler.add_file(new_script, export_fp)
self.file_handler.print_summary()

0 comments on commit 94e2024

Please sign in to comment.