Skip to content

Commit 3d70499

Browse files
codebydivineclaude
andcommitted
Fix code formatting with ruff
Applied automatic code formatting to resolve style inconsistencies: - Fixed string quote normalization in examples - Simplified multi-line string formatting - Removed unnecessary blank lines 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fd47ceb commit 3d70499

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

examples/unified_price_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def print_comprehensive_summary() -> None:
212212
print(" ")
213213
print(" # Detailed analysis with statistics")
214214
print(" stats = await api.price.get(Currency.SOL, include_stats=True)")
215-
print(" print(f'Price: ${stats[\"price\"]:.2f}, Confidence: {stats[\"confidence\"]:.0%}')")
215+
print(' print(f\'Price: ${stats["price"]:.2f}, Confidence: {stats["confidence"]:.0%}\')')
216216
print(" ")
217217
print(" # Check supported currencies")
218218
print(" supported = await api.price.get_supported_currencies()")

src/thegraph_token_api/unified_price_api.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ async def get(
8585
"""
8686
# Validate Currency enum only - no string support
8787
if not isinstance(currency, Currency):
88-
msg = (
89-
f"Currency must be Currency enum, got {type(currency)}. Use Currency.ETH, Currency.SOL, Currency.POL, Currency.BNB, or Currency.AVAX"
90-
)
88+
msg = f"Currency must be Currency enum, got {type(currency)}. Use Currency.ETH, Currency.SOL, Currency.POL, Currency.BNB, or Currency.AVAX"
9189
raise TypeError(msg)
9290

9391
# Check cache first (unless force refresh)
@@ -131,9 +129,7 @@ async def is_supported(self, currency: Currency) -> bool:
131129
True if currency is supported
132130
"""
133131
if not isinstance(currency, Currency):
134-
msg = (
135-
f"Currency must be Currency enum, got {type(currency)}. Use Currency.ETH, Currency.SOL, Currency.POL, Currency.BNB, or Currency.AVAX"
136-
)
132+
msg = f"Currency must be Currency enum, got {type(currency)}. Use Currency.ETH, Currency.SOL, Currency.POL, Currency.BNB, or Currency.AVAX"
137133
raise TypeError(msg)
138134
return is_currency_supported(currency)
139135

@@ -233,8 +229,6 @@ async def _fetch_evm_price(self, config: dict[str, Any], network_id: NetworkId)
233229
# Calculate statistics
234230
return self.calculator.calculate_price_statistics(prices, len(swaps))
235231

236-
237-
238232
async def _fetch_solana_price(self, config: dict[str, Any]) -> dict[str, Any] | None:
239233
"""
240234
Fetch SOL price using Solana DEX swaps.

0 commit comments

Comments
 (0)