-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from igm4ai/test/deep
fix(hansbug): fix a bug of directory creation
- Loading branch information
Showing
5 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cpus = {{ sys.cpu.num }} | ||
mem_size = {{ sys.memory.total | str | potc }} | ||
os = {{ sys.os.type | str | potc }} | ||
python = {{ sys.python | str | potc }} | ||
{% if sys.cuda %} | ||
cuda_version = {{ sys.cuda.version | str | potc }} | ||
gpu_num = {{ sys.gpu.num | potc }} | ||
{% endif %} | ||
|
||
print('This is your first try!') | ||
print(f'UR running {python} on {os}, with a {cpus} core {mem_size} device.') | ||
{% if sys.cuda %} | ||
print(f'CUDA {cuda_version} is also detected, with {gpu_num} gpu(s).') | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import os | ||
|
||
import extras | ||
from extras import wtf | ||
|
||
from igm.render import igm_script | ||
|
||
|
||
@igm_script | ||
def run1(dst): | ||
with open('script_1.ini', 'w') as f: | ||
print('this is one', file=f) | ||
|
||
|
||
@igm_script | ||
def run2(dst): | ||
with open('script_2.txt', 'w') as f: | ||
print('this is two', file=f) | ||
print(dst, file=f) | ||
print(wtf(103, 279), file=f) | ||
print(sorted(dir(extras)), file=f) | ||
print(os.path.getsize('script_1.ini'), file=f) | ||
|
||
|
||
@igm_script | ||
def err(dst): | ||
if os.environ.get('MAKE_ERROR'): | ||
raise ValueError('This is the error') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
|
||
from igm.render import download | ||
|
||
GITHUB_HOST = os.environ.get('GITHUB_HOST', 'github.com') | ||
|
||
|
||
def _get_testfile_url(resource, branch='main') -> str: | ||
if not os.environ.get('NO_GITHUB'): | ||
return f'https://{GITHUB_HOST}/igm4ai/igm-testfile/raw/{branch}/{resource}' | ||
else: | ||
return f'https://gitee.com/hansbug/igm-testfile/raw/{branch}/{resource}' | ||
|
||
|
||
download(_get_testfile_url('gztar_template-simple.tar.gz')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters