Skip to content

Commit 6d9608c

Browse files
testing and linting issues
1 parent d79030f commit 6d9608c

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

macro_agents/src/macro_agents/defs/agents/backtest_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ def auto_promote_best_models_to_production(
904904
continue
905905

906906
try:
907-
model_data = gcs.download_model(
907+
_ = gcs.download_model(
908908
module_name=module_name,
909909
version=version,
910910
context=context,

macro_agents/src/macro_agents/defs/resources/gcs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,18 @@ def setup_for_execution(self, context) -> None:
4848
# It's a JSON string, parse it and use from_service_account_info
4949
try:
5050
creds_info = json.loads(creds_path)
51-
credentials = service_account.Credentials.from_service_account_info(creds_info)
51+
credentials = service_account.Credentials.from_service_account_info(
52+
creds_info
53+
)
5254
except json.JSONDecodeError as e:
5355
raise ValueError(
5456
f"Failed to parse service account JSON from GOOGLE_APPLICATION_CREDENTIALS: {e}"
5557
)
5658
elif os.path.exists(creds_path):
5759
# It's a file path, use from_service_account_file
58-
credentials = service_account.Credentials.from_service_account_file(creds_path)
60+
credentials = service_account.Credentials.from_service_account_file(
61+
creds_path
62+
)
5963
else:
6064
raise FileNotFoundError(
6165
f"Credentials not found. Expected either a valid file path or JSON string, got: {creds_path[:100]}..."

macro_agents/tests/test_dspy_modules.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ def test_module_forward_with_default_personality(self):
6464
result = module.forward(
6565
economic_data="test economic data",
6666
commodity_data="test commodity data",
67+
financial_conditions_index="test financial conditions",
6768
)
6869

6970
assert result.analysis == "Test analysis output"
7071
module.analyze_state.assert_called_once_with(
7172
economic_data="test economic data",
7273
commodity_data="test commodity data",
74+
financial_conditions_index="test financial conditions",
7375
personality="neutral",
7476
)
7577

@@ -84,13 +86,15 @@ def test_module_forward_with_override_personality(self):
8486
result = module.forward(
8587
economic_data="test economic data",
8688
commodity_data="test commodity data",
89+
financial_conditions_index="test financial conditions",
8790
personality="bullish",
8891
)
8992

9093
assert result.analysis == "Test analysis output"
9194
module.analyze_state.assert_called_once_with(
9295
economic_data="test economic data",
9396
commodity_data="test commodity data",
97+
financial_conditions_index="test financial conditions",
9498
personality="bullish",
9599
)
96100

@@ -105,6 +109,7 @@ def test_module_forward_with_empty_data(self):
105109
result = module.forward(
106110
economic_data="",
107111
commodity_data="",
112+
financial_conditions_index="",
108113
)
109114

110115
assert result.analysis == "Analysis with empty data"
@@ -350,12 +355,14 @@ def test_personality_override_priority(self):
350355
module.forward(
351356
economic_data="test",
352357
commodity_data="test",
358+
financial_conditions_index="test financial conditions",
353359
personality="bullish",
354360
)
355361

356362
module.analyze_state.assert_called_once_with(
357363
economic_data="test",
358364
commodity_data="test",
365+
financial_conditions_index="test financial conditions",
359366
personality="bullish",
360367
)
361368

@@ -374,6 +381,7 @@ def test_economy_state_module_with_mock_lm(self):
374381
result = module.forward(
375382
economic_data="GDP,100.0,0.01,0.02,0.03",
376383
commodity_data="Oil,50.0,0.05",
384+
financial_conditions_index="FCI: 0.5",
377385
)
378386

379387
assert result.analysis == "Comprehensive economic analysis"

0 commit comments

Comments
 (0)