Skip to content

Commit

Permalink
Created second click command and function to to create directories in…
Browse files Browse the repository at this point in the history
… which to run OSeMOSYS_step.
  • Loading branch information
HauHe committed Jul 11, 2024
1 parent 0f3a9bb commit aa37c4c
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/osemosys_step/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@

logger = logging.getLogger(__name__)

@click.command()
@click.group()
def cli():
pass

@cli.command("run")
@click.option("--step_length", required=True, multiple=True,
help="""
Provide an integer to indicate the step length, e.g. '5' for
Expand Down Expand Up @@ -621,5 +625,26 @@ def main(input_data: str, step_length: int, path_param: str, cores: int, solver=

next_step += 1

@cli.command("create")
@click.option("--path", required=True, default= '.',
help="Path where the directory structure shall be created."
)
def create_directory_structure(path: str):
"""Function to create directory structure in which OSeMOSYS_step can be run.
The created directory has the below structure:
```bash
OSeMOSYS_step
├── data
│ ├── scenarios
├── model
├── results
└── steps
```
"""
dirs = ['data', ['data', 'scenarios'], 'model', 'results', 'steps']
for d in dirs:
p = Path(path, d)
p.mkdir()

if __name__ == '__main__':
main() #input_data,step_length,path_param,solver)
cli() #input_data,step_length,path_param,solver)

0 comments on commit aa37c4c

Please sign in to comment.