Muyi 0.0.1__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.
@@ -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()`
@@ -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.1", # 当前版本
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
- # url="", # 模块github地址
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.1
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
- # muyi_utils
15
-
16
- Some useful utils for GNNs and Deep Learning.
muyi-0.0.1/PKG-INFO DELETED
@@ -1,16 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: Muyi
3
- Version: 0.0.1
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
- # muyi_utils
15
-
16
- Some useful utils for GNNs and Deep Learning.
muyi-0.0.1/README.md DELETED
@@ -1,3 +0,0 @@
1
- # muyi_utils
2
-
3
- Some useful utils for GNNs and Deep Learning.
muyi-0.0.1/muyi/utils.py DELETED
@@ -1,18 +0,0 @@
1
- import os
2
- import matplotlib.pyplot as plt
3
-
4
- def color_print(content):
5
- print(f'\033[1;46m{content}\033[0m\n')
6
-
7
- def save_pic_iterly(pic_name, postfix, info):
8
- pic_idx=1
9
- pic_name_full=f'{pic_name}_{pic_idx}.{postfix}'
10
-
11
- while os.path.exists(pic_name_full):
12
- print(f'File {pic_name_full} already exists.')
13
- pic_idx += 1
14
- pic_name_full=f'{pic_name}_{pic_idx}.png'
15
-
16
- plt.savefig(pic_name_full, dpi=300, bbox_inches='tight')
17
-
18
- color_print(f'!!!!! {info} is saved in file {pic_name_full}')
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes