weco 0.2.14__py3-none-any.whl → 0.2.15__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.
weco/__init__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  import os
2
2
 
3
3
  # DO NOT EDIT
4
- __pkg_version__ = "0.2.14"
4
+ __pkg_version__ = "0.2.15"
5
5
  __api_version__ = "v1"
6
6
 
7
7
  __base_url__ = f"https://api.weco.ai/{__api_version__}"
weco/cli.py CHANGED
@@ -265,14 +265,14 @@ def main() -> None:
265
265
  "debug_prob": 0.5,
266
266
  "max_debug_depth": max(1, math.ceil(0.1 * steps)),
267
267
  }
268
+ # API request timeout
269
+ timeout = 800
268
270
  # Read additional instructions
269
271
  additional_instructions = read_additional_instructions(additional_instructions=args.additional_instructions)
270
272
  # Read source code path
271
273
  source_fp = pathlib.Path(args.source)
272
274
  # Read source code content
273
275
  source_code = read_from_path(fp=source_fp, is_json=False)
274
- # API request timeout
275
- timeout = 800
276
276
 
277
277
  # --- Panel Initialization ---
278
278
  summary_panel = SummaryPanel(
@@ -310,9 +310,8 @@ def main() -> None:
310
310
  runs_dir = pathlib.Path(args.log_dir) / session_id
311
311
  runs_dir.mkdir(parents=True, exist_ok=True)
312
312
 
313
- # Save the original code (.runs/<session-id>/original.<extension>)
314
- runs_copy_source_fp = runs_dir / f"original{source_fp.suffix}" # Use correct suffix
315
- write_to_path(fp=runs_copy_source_fp, content=source_code)
313
+ # Write the initial code string to the logs
314
+ write_to_path(fp=runs_dir / f"step_0{source_fp.suffix}", content=session_response["code"])
316
315
 
317
316
  # Write the initial code string to the source file path (if not preserving)
318
317
  if not args.preserve_source:
@@ -380,7 +379,8 @@ def main() -> None:
380
379
  transition_delay=0.1,
381
380
  )
382
381
 
383
- for step in range(1, steps):
382
+ # Starting from step 1 to steps (inclusive) because the baseline solution is step 0, so we want to optimize for steps worth of steps
383
+ for step in range(1, steps + 1):
384
384
  # Re-read instructions from the original source (file path or string) BEFORE each suggest call
385
385
  current_additional_instructions = read_additional_instructions(
386
386
  additional_instructions=args.additional_instructions
@@ -553,9 +553,7 @@ def main() -> None:
553
553
  best_solution_score = None
554
554
 
555
555
  if best_solution_code is None or best_solution_score is None:
556
- best_solution_content = (
557
- f"# Weco could not find a better solution\n\n{read_from_path(fp=runs_copy_source_fp, is_json=False)}"
558
- )
556
+ best_solution_content = f"# Weco could not find a better solution\n\n{read_from_path(fp=runs_dir / f'step_0{source_fp.suffix}', is_json=False)}"
559
557
  else:
560
558
  # Format score for the comment
561
559
  best_score_str = (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: weco
3
- Version: 0.2.14
3
+ Version: 0.2.15
4
4
  Summary: Documentation for `weco`, a CLI for using Weco AI's code optimizer.
5
5
  Author-email: Weco AI Team <contact@weco.ai>
6
6
  License: MIT
@@ -0,0 +1,12 @@
1
+ weco/__init__.py,sha256=2P-Z80aRiNeL8hyXD4ExZxizUgLb_Tj_NOydwoqTZ_k,426
2
+ weco/api.py,sha256=z2DCe0kQJaaBHo-Vml52GRc9nwQBnrKATXoY3UfPojw,3842
3
+ weco/auth.py,sha256=IPfiLthcNRkPyM8pWHTyDLvikw83sigacpY1PmeA03Y,2343
4
+ weco/cli.py,sha256=rcntl-hFQorCNSBX1yaNoL-4eBJFSkN5Vo35b6-W4UU,28993
5
+ weco/panels.py,sha256=gB4rZbCvqzewUCBcILvyyU4fnOQLwFgHCGmtn-ZlgSo,13385
6
+ weco/utils.py,sha256=hhIebUPnetFMfNSFfcsKVw1TSpeu_Zw3rBPPnxDie0U,3911
7
+ weco-0.2.15.dist-info/licenses/LICENSE,sha256=p_GQqJBvuZgkLNboYKyH-5dhpTDlKs2wq2TVM55WrWE,1065
8
+ weco-0.2.15.dist-info/METADATA,sha256=B97o-KOP1o2sUVHqSz1maZGy-iysBKBbvq16QIyVE68,10851
9
+ weco-0.2.15.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
10
+ weco-0.2.15.dist-info/entry_points.txt,sha256=ixJ2uClALbCpBvnIR6BXMNck8SHAab8eVkM9pIUowcs,39
11
+ weco-0.2.15.dist-info/top_level.txt,sha256=F0N7v6e2zBSlsorFv-arAq2yDxQbzX3KVO8GxYhPUeE,5
12
+ weco-0.2.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,12 +0,0 @@
1
- weco/__init__.py,sha256=q4zeQ8CJq8NJyRcBMmST6zCzmK_HjNSFChrNBzJ9oks,426
2
- weco/api.py,sha256=z2DCe0kQJaaBHo-Vml52GRc9nwQBnrKATXoY3UfPojw,3842
3
- weco/auth.py,sha256=IPfiLthcNRkPyM8pWHTyDLvikw83sigacpY1PmeA03Y,2343
4
- weco/cli.py,sha256=7pGJiyoBO7n6Xocwusx9iVqsaPj8OuPaJ1A2ks83Ekw,28961
5
- weco/panels.py,sha256=gB4rZbCvqzewUCBcILvyyU4fnOQLwFgHCGmtn-ZlgSo,13385
6
- weco/utils.py,sha256=hhIebUPnetFMfNSFfcsKVw1TSpeu_Zw3rBPPnxDie0U,3911
7
- weco-0.2.14.dist-info/licenses/LICENSE,sha256=p_GQqJBvuZgkLNboYKyH-5dhpTDlKs2wq2TVM55WrWE,1065
8
- weco-0.2.14.dist-info/METADATA,sha256=855avaVBC-wUyFDWIvITw0t4o_v4s90Us-t_3lQnPGw,10851
9
- weco-0.2.14.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
10
- weco-0.2.14.dist-info/entry_points.txt,sha256=ixJ2uClALbCpBvnIR6BXMNck8SHAab8eVkM9pIUowcs,39
11
- weco-0.2.14.dist-info/top_level.txt,sha256=F0N7v6e2zBSlsorFv-arAq2yDxQbzX3KVO8GxYhPUeE,5
12
- weco-0.2.14.dist-info/RECORD,,