Browse Source

修正项目结构,添加test目录

liuyuqi-dellpc 5 years ago
parent
commit
67dff207ea
10 changed files with 22 additions and 3 deletions
  1. 6 3
      code/sort_by_disk.py
  2. 0 0
      test/read_file.py
  3. 0 0
      test/read_file2.py
  4. 0 0
      test/t.py
  5. 0 0
      test/t2.py
  6. 0 0
      test/t4.py
  7. 16 0
      test/t5.py
  8. 0 0
      test/t_logging.py
  9. 0 0
      test/test_pandas.py
  10. 0 0
      test/time.py

+ 6 - 3
code/sort_by_disk.py

@@ -90,7 +90,7 @@ def restrictApps(instance, deploy_list):
                 if ct[instance] + 1 > tmp["max_interference"]:
                     return False
             else:
-                #在限制表中找不到限制条件
+                # 在限制表中找不到限制条件
                 return True
 
 
@@ -105,13 +105,16 @@ def deploy():
     while row > 0:
         deployInstance(row)
         # 整个instace都遍历了,第j主机无法再放入一个,所以添加j+1主机
+        df3 = df3[df3["isdeploy"] == False]
+        # 重建行索引
+        # df3.reindex()
+        # df3.iloc[:, 0].reset_index(drop=True)
         row, column = df3.shape
         j = j + 1
-        # j++之后表示新建主机,所以新主机没有部署任何实例,为false
+        # j++之后表示新建主机,所以新主机没有部署任何实例,为false,然后初始化所有其他参数
         is_deploy = False
         tem_pre_disk = tem_pre_mem = tem_pre_cpu = tem_pre_P = tem_pre_M = tem_pre_PM = 0
         tem_disk = tem_mem = tem_cpu = tem_P = tem_M = tem_PM = 0
-        df3 = df3[df3["isdeploy"] == False]
         deploy_list = list()
 
     # 部署完事

+ 0 - 0
code/read_file.py → test/read_file.py


+ 0 - 0
code/read_file2.py → test/read_file2.py


+ 0 - 0
code/t.py → test/t.py


+ 0 - 0
code/t2.py → test/t2.py


+ 0 - 0
code/t4.py → test/t4.py


+ 16 - 0
test/t5.py

@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+'''
+@Auther :liuyuqi.gov@msn.cn
+@Time :2018/7/9 2:07
+@File :t5.py
+'''
+
+import pandas as pd
+
+obj3 = pd.Series(['blue', 'purple', 'yellow'], index=[0, 2, 4])
+print(obj3)
+obj4 = obj3.reset_index(drop=True)
+print(obj4)
+print(type(obj4))
+

+ 0 - 0
code/t_logging.py → test/t_logging.py


+ 0 - 0
code/test_pandas.py → test/test_pandas.py


+ 0 - 0
code/time.py → test/time.py