Muyi 0.0.0__tar.gz → 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- muyi-0.0.2/Muyi.egg-info/PKG-INFO +46 -0
- {muyi-0.0.0 → muyi-0.0.2}/Muyi.egg-info/SOURCES.txt +1 -0
- muyi-0.0.2/PKG-INFO +46 -0
- muyi-0.0.2/README.md +32 -0
- muyi-0.0.0/muyi/utils.py → muyi-0.0.2/muyi/gpu.py +1 -20
- muyi-0.0.2/muyi/utils.py +43 -0
- {muyi-0.0.0 → muyi-0.0.2}/setup.py +2 -2
- muyi-0.0.0/Muyi.egg-info/PKG-INFO +0 -16
- muyi-0.0.0/PKG-INFO +0 -16
- muyi-0.0.0/README.md +0 -3
- {muyi-0.0.0 → muyi-0.0.2}/LICENSE +0 -0
- {muyi-0.0.0 → muyi-0.0.2}/Muyi.egg-info/dependency_links.txt +0 -0
- {muyi-0.0.0 → muyi-0.0.2}/Muyi.egg-info/top_level.txt +0 -0
- {muyi-0.0.0 → muyi-0.0.2}/muyi/__init__.py +0 -0
- {muyi-0.0.0 → muyi-0.0.2}/muyi/graph.py +0 -0
- {muyi-0.0.0 → muyi-0.0.2}/pyproject.toml +0 -0
- {muyi-0.0.0 → muyi-0.0.2}/setup.cfg +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: Muyi
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Some useful utils.
|
|
5
|
+
Home-page: https://github.com/Muyiiiii/muyi
|
|
6
|
+
Author: muyiiiii
|
|
7
|
+
Author-email:
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
# muyi
|
|
16
|
+
|
|
17
|
+
Some useful utils for GNNs and Deep Learning.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install muyi
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## utils
|
|
30
|
+
|
|
31
|
+
1. `color_print(content)`
|
|
32
|
+
2. `save_pic_iterly(pic_name, postfix, info)`
|
|
33
|
+
3. `read_csv_iterly(path, **kwargs)`
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## graph
|
|
38
|
+
|
|
39
|
+
1. `pyg_data_to_dgl_graph(pyg_data_obj)`
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## gpu
|
|
44
|
+
|
|
45
|
+
1. `get_gpu_memory_usage()`
|
|
46
|
+
2. `display_gpu_memory_usage()`
|
muyi-0.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: Muyi
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Summary: Some useful utils.
|
|
5
|
+
Home-page: https://github.com/Muyiiiii/muyi
|
|
6
|
+
Author: muyiiiii
|
|
7
|
+
Author-email:
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
# muyi
|
|
16
|
+
|
|
17
|
+
Some useful utils for GNNs and Deep Learning.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install muyi
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## utils
|
|
30
|
+
|
|
31
|
+
1. `color_print(content)`
|
|
32
|
+
2. `save_pic_iterly(pic_name, postfix, info)`
|
|
33
|
+
3. `read_csv_iterly(path, **kwargs)`
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
## graph
|
|
38
|
+
|
|
39
|
+
1. `pyg_data_to_dgl_graph(pyg_data_obj)`
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## gpu
|
|
44
|
+
|
|
45
|
+
1. `get_gpu_memory_usage()`
|
|
46
|
+
2. `display_gpu_memory_usage()`
|
muyi-0.0.2/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# muyi
|
|
2
|
+
|
|
3
|
+
Some useful utils for GNNs and Deep Learning.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install muyi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## utils
|
|
16
|
+
|
|
17
|
+
1. `color_print(content)`
|
|
18
|
+
2. `save_pic_iterly(pic_name, postfix, info)`
|
|
19
|
+
3. `read_csv_iterly(path, **kwargs)`
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## graph
|
|
24
|
+
|
|
25
|
+
1. `pyg_data_to_dgl_graph(pyg_data_obj)`
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## gpu
|
|
30
|
+
|
|
31
|
+
1. `get_gpu_memory_usage()`
|
|
32
|
+
2. `display_gpu_memory_usage()`
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import matplotlib.pyplot as plt
|
|
3
|
-
|
|
4
1
|
import GPUtil
|
|
5
2
|
|
|
6
3
|
def get_gpu_memory_usage():
|
|
@@ -20,20 +17,4 @@ def display_gpu_memory_usage():
|
|
|
20
17
|
for info in gpu_memory_info:
|
|
21
18
|
print(f"GPU ID: {info[0]}, Name: {info[1]}, Memory Used: {info[2]}, Total Memory: {info[3]}, Memory Utilization: {info[4]}")
|
|
22
19
|
else:
|
|
23
|
-
print("No GPU found.")
|
|
24
|
-
|
|
25
|
-
def color_print(content):
|
|
26
|
-
print(f'\033[1;46m{content}\033[0m\n')
|
|
27
|
-
|
|
28
|
-
def save_pic_iterly(pic_name, postfix, info):
|
|
29
|
-
pic_idx=1
|
|
30
|
-
pic_name_full=f'{pic_name}_{pic_idx}.{postfix}'
|
|
31
|
-
|
|
32
|
-
while os.path.exists(pic_name_full):
|
|
33
|
-
print(f'File {pic_name_full} already exists.')
|
|
34
|
-
pic_idx += 1
|
|
35
|
-
pic_name_full=f'{pic_name}_{pic_idx}.png'
|
|
36
|
-
|
|
37
|
-
plt.savefig(pic_name_full, dpi=300, bbox_inches='tight')
|
|
38
|
-
|
|
39
|
-
color_print(f'!!!!! {info} is saved in file {pic_name_full}')
|
|
20
|
+
print("No GPU found.")
|
muyi-0.0.2/muyi/utils.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from tqdm import tqdm
|
|
5
|
+
|
|
6
|
+
def color_print(content):
|
|
7
|
+
print(f'\033[1;46m{content}\033[0m\n')
|
|
8
|
+
|
|
9
|
+
def save_pic_iterly(pic_name, postfix, info):
|
|
10
|
+
pic_idx=1
|
|
11
|
+
pic_name_full=f'{pic_name}_{pic_idx}.{postfix}'
|
|
12
|
+
|
|
13
|
+
while os.path.exists(pic_name_full):
|
|
14
|
+
print(f'File {pic_name_full} already exists.')
|
|
15
|
+
pic_idx += 1
|
|
16
|
+
pic_name_full=f'{pic_name}_{pic_idx}.png'
|
|
17
|
+
|
|
18
|
+
plt.savefig(pic_name_full, dpi=300, bbox_inches='tight')
|
|
19
|
+
|
|
20
|
+
color_print(f'!!!!! {info} is saved in file {pic_name_full}')
|
|
21
|
+
|
|
22
|
+
def read_csv_iterly(path, **kwargs):
|
|
23
|
+
INPUT_FILENAME = path
|
|
24
|
+
LINES_TO_READ_FOR_ESTIMATION = 20
|
|
25
|
+
CHUNK_SIZE_PER_ITERATION = 10**5
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
temp = pd.read_csv(INPUT_FILENAME,
|
|
29
|
+
nrows=LINES_TO_READ_FOR_ESTIMATION, **kwargs)
|
|
30
|
+
N = len(temp.to_csv(index=False))
|
|
31
|
+
df = [temp[:0]]
|
|
32
|
+
t = int(os.path.getsize(INPUT_FILENAME)/N*LINES_TO_READ_FOR_ESTIMATION/CHUNK_SIZE_PER_ITERATION) + 1
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
with tqdm(total = t, file = sys.stdout) as pbar:
|
|
36
|
+
for i,chunk in enumerate(pd.read_csv(INPUT_FILENAME, chunksize=CHUNK_SIZE_PER_ITERATION, low_memory=False, **kwargs)):
|
|
37
|
+
df.append(chunk)
|
|
38
|
+
pbar.set_description('Importing: %d' % (1 + i))
|
|
39
|
+
pbar.update(1)
|
|
40
|
+
|
|
41
|
+
data = temp[:0].append(df)
|
|
42
|
+
del df
|
|
43
|
+
return data
|
|
@@ -3,13 +3,13 @@ with open("README.md", "r") as fh:
|
|
|
3
3
|
long_description = fh.read()
|
|
4
4
|
setuptools.setup(
|
|
5
5
|
name="Muyi", # 模块名称
|
|
6
|
-
version="0.0.
|
|
6
|
+
version="0.0.2", # 当前版本
|
|
7
7
|
author="muyiiiii", # 作者
|
|
8
8
|
author_email="", # 作者邮箱
|
|
9
9
|
description="Some useful utils.", # 模块简介
|
|
10
10
|
long_description=long_description, # 模块详细介绍
|
|
11
11
|
long_description_content_type="text/markdown", # 模块详细介绍格式
|
|
12
|
-
|
|
12
|
+
url="https://github.com/Muyiiiii/muyi", # 模块github地址
|
|
13
13
|
packages=setuptools.find_packages(), # 自动找到项目中导入的模块
|
|
14
14
|
# 模块相关的元数据
|
|
15
15
|
classifiers=[
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Muyi
|
|
3
|
-
Version: 0.0.0
|
|
4
|
-
Summary: Some useful utils.
|
|
5
|
-
Author: muyiiiii
|
|
6
|
-
Author-email:
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
|
|
14
|
-
# muyiiiii_graph
|
|
15
|
-
|
|
16
|
-
Some useful utils for GNNs.
|
muyi-0.0.0/PKG-INFO
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: Muyi
|
|
3
|
-
Version: 0.0.0
|
|
4
|
-
Summary: Some useful utils.
|
|
5
|
-
Author: muyiiiii
|
|
6
|
-
Author-email:
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
|
|
14
|
-
# muyiiiii_graph
|
|
15
|
-
|
|
16
|
-
Some useful utils for GNNs.
|
muyi-0.0.0/README.md
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|