Skip to content

Commit b61e308

Browse files
fix: use keyword args for Pydantic Output class instantiation
1 parent b254828 commit b61e308

12 files changed

Lines changed: 28 additions & 26 deletions

File tree

extropy/cli/commands/chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def chat_list(
399399
):
400400
"""List recent runs with sample agents for quick chat selection."""
401401
agent_mode = is_agent_mode()
402-
out = Output(console, json_mode=agent_mode)
402+
out = Output(console=console, json_mode=agent_mode)
403403

404404
study_db = _get_study_db()
405405
conn = sqlite3.connect(str(study_db))
@@ -593,7 +593,7 @@ def chat_ask(
593593
extropy chat ask --run-id r1 --agent-id a1 --prompt "What changed?"
594594
"""
595595
agent_mode = is_agent_mode()
596-
out = Output(console, json_mode=agent_mode)
596+
out = Output(console=console, json_mode=agent_mode)
597597

598598
study_db = _get_study_db()
599599
started = time.time()

extropy/cli/commands/estimate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def estimate_command(
5151

5252
CostTracker.get().set_context(command="estimate")
5353

54-
out = Output(console)
54+
out = Output(console=console)
5555

5656
# Resolve study context
5757
study_path = get_study_path()
@@ -82,7 +82,9 @@ def estimate_command(
8282
scenario_path = study_ctx.get_scenario_path(scenario_name, scenario_version)
8383
scenario_spec = ScenarioSpec.from_yaml(scenario_path)
8484
except FileNotFoundError:
85-
out.error(f"Scenario not found: {scenario_name}", exit_code=ExitCode.FILE_NOT_FOUND)
85+
out.error(
86+
f"Scenario not found: {scenario_name}", exit_code=ExitCode.FILE_NOT_FOUND
87+
)
8688
raise typer.Exit(out.finish())
8789
except Exception as e:
8890
out.error(f"Failed to load scenario: {e}")

extropy/cli/commands/network.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ def network_command(
5151
seed: int | None = typer.Option(
5252
None, "--seed", help="Random seed for reproducibility"
5353
),
54-
validate: bool = typer.Option(
55-
False, "--validate", help="Print validation metrics"
56-
),
54+
validate: bool = typer.Option(False, "--validate", help="Print validation metrics"),
5755
no_metrics: bool = typer.Option(
5856
False, "--no-metrics", help="Skip computing node metrics (faster)"
5957
),
@@ -214,7 +212,7 @@ def network_command(
214212
CostTracker.get().set_context(command="network")
215213

216214
agent_mode = is_agent_mode()
217-
out = Output(console, json_mode=agent_mode)
215+
out = Output(console=console, json_mode=agent_mode)
218216
start_time = time.time()
219217

220218
if not agent_mode:
@@ -256,7 +254,9 @@ def network_command(
256254
scenario_path = study_ctx.get_scenario_path(scenario_name, scenario_version)
257255
scenario_spec = ScenarioSpec.from_yaml(scenario_path)
258256
except FileNotFoundError:
259-
out.error(f"Scenario not found: {scenario_name}", exit_code=ExitCode.FILE_NOT_FOUND)
257+
out.error(
258+
f"Scenario not found: {scenario_name}", exit_code=ExitCode.FILE_NOT_FOUND
259+
)
260260
raise typer.Exit(out.finish())
261261
except Exception as e:
262262
out.error(f"Failed to load scenario: {e}")

extropy/cli/commands/persona.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def persona_command(
7878

7979
start_time = time.time()
8080
agent_mode = is_agent_mode()
81-
out = Output(console, json_mode=agent_mode)
81+
out = Output(console=console, json_mode=agent_mode)
8282

8383
if not agent_mode:
8484
console.print()

extropy/cli/commands/query.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def query_agents(
9999
"""Dump agent attributes."""
100100
study_db = _get_study_db()
101101
agent_mode = is_agent_mode()
102-
out = Output(console, json_mode=agent_mode)
102+
out = Output(console=console, json_mode=agent_mode)
103103

104104
conn = sqlite3.connect(str(study_db))
105105
conn.row_factory = sqlite3.Row
@@ -145,7 +145,7 @@ def query_edges(
145145
"""Dump network edges."""
146146
study_db = _get_study_db()
147147
agent_mode = is_agent_mode()
148-
out = Output(console, json_mode=agent_mode)
148+
out = Output(console=console, json_mode=agent_mode)
149149

150150
conn = sqlite3.connect(str(study_db))
151151
conn.row_factory = sqlite3.Row
@@ -190,7 +190,7 @@ def query_states(
190190
"""Dump agent states for a simulation run."""
191191
study_db = _get_study_db()
192192
agent_mode = is_agent_mode()
193-
out = Output(console, json_mode=agent_mode)
193+
out = Output(console=console, json_mode=agent_mode)
194194

195195
conn = sqlite3.connect(str(study_db))
196196
conn.row_factory = sqlite3.Row
@@ -252,7 +252,7 @@ def query_summary(
252252
"""Show study entity counts."""
253253
study_db = _get_study_db()
254254
agent_mode = is_agent_mode()
255-
out = Output(console, json_mode=agent_mode)
255+
out = Output(console=console, json_mode=agent_mode)
256256

257257
conn = sqlite3.connect(str(study_db))
258258
conn.row_factory = sqlite3.Row
@@ -322,7 +322,7 @@ def query_network(
322322
"""Show network statistics."""
323323
study_db = _get_study_db()
324324
agent_mode = is_agent_mode()
325-
out = Output(console, json_mode=agent_mode)
325+
out = Output(console=console, json_mode=agent_mode)
326326

327327
conn = sqlite3.connect(str(study_db))
328328
conn.row_factory = sqlite3.Row
@@ -378,7 +378,7 @@ def query_network_status(
378378
"""Show network calibration progress."""
379379
study_db = _get_study_db()
380380
agent_mode = is_agent_mode()
381-
out = Output(console, json_mode=agent_mode)
381+
out = Output(console=console, json_mode=agent_mode)
382382

383383
conn = sqlite3.connect(str(study_db))
384384
conn.row_factory = sqlite3.Row

extropy/cli/commands/results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def results_callback(
4040
extropy results agent agent_123 # single agent details
4141
"""
4242
agent_mode = is_agent_mode()
43-
out = Output(console, json_mode=agent_mode)
43+
out = Output(console=console, json_mode=agent_mode)
4444

4545
# Resolve study context
4646
study_path = get_study_path()

extropy/cli/commands/sample.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def sample_command(
6868
from ...population.sampler import sample_population, SamplingError
6969

7070
agent_mode = is_agent_mode()
71-
out = Output(console, json_mode=agent_mode)
71+
out = Output(console=console, json_mode=agent_mode)
7272
start_time = time.time()
7373
out.blank()
7474

@@ -107,7 +107,9 @@ def sample_command(
107107
scenario_path = study_ctx.get_scenario_path(scenario_name, scenario_version)
108108
scenario_spec = ScenarioSpec.from_yaml(scenario_path)
109109
except FileNotFoundError:
110-
out.error(f"Scenario not found: {scenario_name}", exit_code=ExitCode.FILE_NOT_FOUND)
110+
out.error(
111+
f"Scenario not found: {scenario_name}", exit_code=ExitCode.FILE_NOT_FOUND
112+
)
111113
raise typer.Exit(out.finish())
112114
except Exception as e:
113115
out.error(f"Failed to load scenario: {e}")

extropy/cli/commands/scenario.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def scenario_command(
7575

7676
start_time = time.time()
7777
agent_mode = is_agent_mode()
78-
out = Output(console, json_mode=agent_mode)
78+
out = Output(console=console, json_mode=agent_mode)
7979

8080
if not agent_mode:
8181
console.print()

extropy/cli/commands/simulate.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def simulate_command(
234234
setup_logging(verbose=verbose, debug=debug)
235235

236236
agent_mode = is_agent_mode()
237-
out = Output(console, json_mode=agent_mode)
237+
out = Output(console=console, json_mode=agent_mode)
238238
start_time = time.time()
239239

240240
if not agent_mode:
@@ -561,5 +561,3 @@ def do_simulation():
561561
console.print(f"Results saved to: [bold]{output}[/bold]")
562562

563563
raise typer.Exit(out.finish())
564-
565-

extropy/cli/commands/spec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def spec_command(
8383

8484
start_time = time.time()
8585
agent_mode = is_agent_mode()
86-
out = Output(console, json_mode=agent_mode)
86+
out = Output(console=console, json_mode=agent_mode)
8787

8888
if not agent_mode:
8989
console.print()

0 commit comments

Comments
 (0)