pilot.linkstec 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl

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.
@@ -11,6 +11,8 @@ class ConfigDTO:
11
11
  project: str
12
12
  steps: list[str]
13
13
  skipsteps: list[str]
14
+ runsteps: list[str]
15
+ multisteps: list[str]
14
16
 
15
17
 
16
18
 
@@ -79,11 +81,17 @@ class ConfigReader:
79
81
  steps = [s.strip() for s in steps_str.split(',')] if steps_str else []
80
82
  skipsteps_str = self.get('DEFAULT', 'skipsteps', fallback='')
81
83
  skipsteps = [s.strip() for s in skipsteps_str.split(',')] if skipsteps_str else []
84
+ runsteps_str = self.get('DEFAULT', 'runstep', fallback='')
85
+ runsteps = [s.strip() for s in runsteps_str.split(',')] if runsteps_str else []
86
+ multisteps_str = self.get('DEFAULT', 'multistep', fallback='')
87
+ multisteps = [s.strip() for s in multisteps_str.split(',')] if multisteps_str else []
82
88
 
83
89
  return ConfigDTO(
84
90
  work_space=work_space,
85
91
  threads=threads,
86
92
  project=project,
87
93
  steps=steps,
88
- skipsteps=skipsteps
94
+ skipsteps=skipsteps,
95
+ runsteps=runsteps,
96
+ multisteps=multisteps
89
97
  )
@@ -66,6 +66,7 @@ class VertexAISingleton:
66
66
  lines = lines[:-1]
67
67
  return "\n".join(lines)
68
68
 
69
+ @classmethod
69
70
  def get_instance(cls, model_name: str = "gemini-2.5-pro") -> 'VertexAISingleton':
70
71
  """インスタンスを取得"""
71
72
  return cls(model_name)
@@ -1,11 +1,13 @@
1
1
  import os
2
+ from concurrent.futures import ThreadPoolExecutor
3
+ import time
2
4
 
3
5
  from pilot.unit.unit_interface import UnitInterface
4
6
  from pilot.job.impl.base_job import BaseJob
5
- from pilot.config.config_reader import ConfigReader
7
+ from pilot.config.config_reader import ConfigReader, ConfigDTO # 追加
6
8
 
7
9
  class BaseUnit(UnitInterface):
8
- config_dto = None
10
+ config_dto: ConfigDTO = None # 型アノテーションを追加
9
11
  joblist = []
10
12
 
11
13
  def __init__(self):
@@ -18,12 +20,43 @@ class BaseUnit(UnitInterface):
18
20
  def run(self):
19
21
  steps = self.config_dto.steps
20
22
  skipsteps = self.config_dto.skipsteps
21
- for index, step in enumerate(steps):
23
+
24
+ runsteps = self.config_dto.runsteps
25
+
26
+ def run_step(index):
27
+ if index >= len(steps):
28
+ return
29
+ step = steps[index]
22
30
  if step in skipsteps:
23
- continue
24
- self._run_jobs_in_step_dir(self.config_dto.work_space+ "/" +step,step,index)
31
+ run_step(index + 1)
32
+ return
33
+
34
+ if len(runsteps) == 0 :
35
+ pass
36
+ elif len(runsteps) != 0 and step not in runsteps:
37
+ run_step(index + 1)
38
+ return
39
+
40
+ current_step_dir = self.config_dto.work_space + "/" + step
41
+
42
+ max_workers = self.config_dto.threads
43
+ unit_multisteps = self.config_dto.multisteps
44
+ if step in unit_multisteps:
45
+ max_workers = self.config_dto.threads
46
+ else:
47
+ max_workers = 1
48
+ def step_worker():
49
+ self._run_jobs_in_step_dir(current_step_dir, step, index)
50
+
51
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
52
+ future = executor.submit(step_worker)
53
+ future.result()
54
+ # STEP完了後、次のSTEPを実行
55
+ run_step(index + 1)
56
+
57
+ run_step(0)
25
58
 
26
- def _run_jobs_in_step_dir(self, current_step_dir, step,index):
59
+ def _run_jobs_in_step_dir(self, current_step_dir, step, index):
27
60
  for dirpath, _, filenames in os.walk(current_step_dir):
28
61
  for filename in filenames:
29
62
  file_path = os.path.join(dirpath, filename)
@@ -32,7 +65,7 @@ class BaseUnit(UnitInterface):
32
65
  job.current_step = step
33
66
  job.step_index = index
34
67
  job.file_path = file_path
35
- if self.job_need_run(job,filename,index):
68
+ if self.job_need_run(job, filename, index):
36
69
  job.run()
37
70
 
38
71
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pilot.linkstec
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: pilot of the ship, a tool for managing and deploying Python projects.
5
5
  Author-email: wanglr <wanglr1980@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  pilot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  pilot/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- pilot/config/config_reader.py,sha256=RL9925CIjKyimvcspzmZkPzJUJe6z28cfz5nGhZ3g3k,3308
3
+ pilot/config/config_reader.py,sha256=wrb6bIDMYqZfp0KtoYIzoRMLmbKVEFaRhydm-csJaKM,3752
4
4
  pilot/control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  pilot/control/control_interface.py,sha256=zGv380oQgAKPAIHDHeFdPYzhj2Ngo2T66NWlNloA7vY,124
6
6
  pilot/control/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -9,7 +9,7 @@ pilot/conver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  pilot/conver/converfileEncodding.py,sha256=UqjcWO0bzkuTRHLEWrWJkeo3p-P7WuYE7jFKveyPekA,2781
10
10
  pilot/conver/nkf_converter.py,sha256=JqgThmXcdnTGMsLIHUEwe8sc0VGMqDaKCIQTg-UE3WE,1148
11
11
  pilot/generater/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- pilot/generater/vertexai.py,sha256=1WiecrEE05u7nEpW7G9iZL-CzXJqhyrQgluCk8bPQCo,2573
12
+ pilot/generater/vertexai.py,sha256=v-hEvPwsUtrxP57yu9f5pUBj7BGImegO4lv10QWM1XA,2591
13
13
  pilot/job/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  pilot/job/job_interface.py,sha256=LL0hfuFfnKnkpQD99jv1hkaAIAFM-JJPrX3PFxN6O_A,120
15
15
  pilot/job/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -19,11 +19,11 @@ pilot/splitters/cobolsplitter.py,sha256=oPwxKRjA7TyXWaWV3jdy59lJZy1mRn6yxD9ivqFY
19
19
  pilot/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  pilot/unit/unit_interface.py,sha256=fE8N4h_rZU-dWLHy9o0EE3yyErGmRyIuGUDb-zqe7qo,167
21
21
  pilot/unit/impl/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
22
- pilot/unit/impl/base_unit.py,sha256=fD9WI5L80m9d1qqr5-I7Bw0jtzK66Ql5Rj2rrQjjZ-Q,1275
22
+ pilot/unit/impl/base_unit.py,sha256=WFs_NUfIqvsvcPMDCV4iRnGMZ3u-QXOvw2H1f-ru7XM,2389
23
23
  pilot/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  pilot/util/files.py,sha256=v9uzfzo3Aq4xgnUIASEZeBJoA2nD9Qz_EA3P-FwzGFQ,1896
25
- pilot_linkstec-0.0.7.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
26
- pilot_linkstec-0.0.7.dist-info/METADATA,sha256=A_N8TQe3dWEYfCDrRwkOyVA7Kx7ba4KhMa0Q4QoQ2iY,678
27
- pilot_linkstec-0.0.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
- pilot_linkstec-0.0.7.dist-info/top_level.txt,sha256=BijnVJdXnIPxxx3s60M848seL4Z12gNUPod6KPJxK9c,6
29
- pilot_linkstec-0.0.7.dist-info/RECORD,,
25
+ pilot_linkstec-0.0.9.dist-info/licenses/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
26
+ pilot_linkstec-0.0.9.dist-info/METADATA,sha256=8WOt5vvtpKqljRZJIEedu0RaJ1cG6U9pEva2BUwg06k,678
27
+ pilot_linkstec-0.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
28
+ pilot_linkstec-0.0.9.dist-info/top_level.txt,sha256=BijnVJdXnIPxxx3s60M848seL4Z12gNUPod6KPJxK9c,6
29
+ pilot_linkstec-0.0.9.dist-info/RECORD,,