Skip to content

Commit 3d9b03f

Browse files
committed
Code improvements
1 parent eb4149a commit 3d9b03f

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

aeon/facade/driver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from dataclasses import dataclass
33
from functools import reduce
4-
from typing import Any, Iterable
4+
from typing import Any, Iterable, Optional
55

66
from aeon.backend.evaluator import EvaluationContext
77
from aeon.backend.evaluator import eval
@@ -67,7 +67,7 @@ def parse_core(self, filename: str):
6767
self.core_ast = parse_term(aeon_code)
6868
self.metadata: Metadata = {}
6969

70-
def parse(self, filename: str = None, aeon_code: str = None) -> Iterable[AeonError]:
70+
def parse(self, filename: str, aeon_code: str | None = None) -> Iterable[AeonError]:
7171
if aeon_code is None:
7272
aeon_code = read_file(filename)
7373

@@ -135,7 +135,7 @@ def has_synth(self) -> bool:
135135
def synth(self) -> STerm:
136136
with RecordTime("Synthesis"):
137137
synthesizer = make_synthesizer(self.cfg.synthesizer)
138-
mapping: dict[Name, Term] = synthesize_holes(
138+
mapping: dict[Name, Optional[Term]] = synthesize_holes(
139139
self.typing_ctx,
140140
self.evaluation_ctx,
141141
self.core,
@@ -157,7 +157,7 @@ def synth(self) -> STerm:
157157

158158
return lift(core_ast_anf)
159159

160-
def pretty_print(self, filename: str = None, should_be_fixed: bool = False) -> None:
160+
def pretty_print(self, filename: str, should_be_fixed: bool = False) -> None:
161161
aeon_code = read_file(filename)
162162
prog: Program = parse_main_program(aeon_code, filename=filename)
163163
prog = bind_program(prog, [])

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies = [
2626
'lark',
2727
'loguru',
2828
'geneticengine==0.8.10',
29+
'lsprotocol',
2930
'multiprocess',
3031
'numpy',
3132
'ollama',

0 commit comments

Comments
 (0)