| Conditions | 2 |
| Total Lines | 34 |
| Code Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """This module downloads and installs demandregio's disaggregator from GitHub |
||
| 10 | def clone_and_install(): |
||
| 11 | """ Clone and install repository of demandregio's disaggregator |
||
| 12 | |||
| 13 | Returns |
||
| 14 | ------- |
||
| 15 | None. |
||
| 16 | |||
| 17 | """ |
||
| 18 | |||
| 19 | source = egon.data.config.datasets()['demandregio_installation']['sources'] |
||
| 20 | |||
| 21 | repo_path = Path(".") / (egon.data.config.datasets() |
||
| 22 | ['demandregio_installation']['targets']["path"]) |
||
| 23 | |||
| 24 | if not os.path.exists(repo_path): |
||
| 25 | os.mkdir(repo_path) |
||
| 26 | subprocess.run( |
||
| 27 | [ |
||
| 28 | "git", |
||
| 29 | "clone", |
||
| 30 | "--single-branch", |
||
| 31 | "--branch", |
||
| 32 | source["branch"], |
||
| 33 | source["git-repository"], |
||
| 34 | ], |
||
| 35 | cwd=repo_path |
||
| 36 | ) |
||
| 37 | |||
| 38 | subprocess.run( |
||
| 39 | [ |
||
| 40 | "pip", |
||
| 41 | "install", |
||
| 42 | "-e", |
||
| 43 | (repo_path/'disaggregator').absolute(), |
||
| 44 | ], |
||
| 45 | ) |