leap.main module¶
- leap.main.get_config(path_config: str) dict [source]¶
Get the configuration settings from a
json
file.
- leap.main.handle_output_path(dir_name: str) pathlib.Path | None [source]¶
Provides path for output data by handling user input through CLI prompts.
Assuming
WORKSPACE
is directory whereleap
was called, thenWORKSPACE/leap_output/dir_name
is checkedIf that path exists then user is prompted to continue (overwriting the current outputs)
If that path doesn’t exist then user is prompted whether to create it
- Parameters:¶
- dir_name: str¶
The name of the directory to store the outputs in.
- Returns:¶
Either the path to the output folder, or
None
, signifying to abort
Examples
(assuming
/home/user/WORKSPACE
is the currect working directory)handle_output_path('mydir1') # assuming the user confirmed to create mydir1 > '/home/user/WORKSPACE/leap_output/mydir1' handle_output_path('mydir1') # assuming the user confirmed to continue with existing mydir1 > '/home/user/WORKSPACE/leap_output/mydir1' handle_output_path('mydir1') # assuming the user did not confirm to continue with existing mydir1 > None handle_output_path('mydir2') # assuming the user did not confirm to create mydir2 > None
- leap.main.force_output_path(dir_name: str) pathlib.Path [source]¶
Provides path for output data without user input.
Assuming
WORKSPACE
is the directory whereleap
was called, thenWORKSPACE/leap_output/dir_name
is checkedIf that path exists then that dir is used (overwriting any existing data)
If that path doesn’t exist then is created and used
- Parameters:¶
- dir_name: str¶
The name of the directory to store the outputs in
- Returns:¶
Either the path to the output folder or
None
, signifying to abort
Examples
(assuming
/home/user/WORKSPACE
is the currect working directory)force_output_path('mydir') > '/home/user/WORKSPACE/leap_output/mydir'