Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Hai Luong 2026-03-18 11:39:01 +01:00 committed by GitHub
parent a660861d36
commit e26ba598ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -20,7 +20,7 @@ import die
import os
from die import Die, Location, Connection
from dataclasses import dataclass
from typing import List, Dict
from typing import List, Dict, FrozenSet, Optional
from timing import decompress_timing
DATABASE_VERSION = 1.12
@ -40,10 +40,15 @@ class Pad:
class Bank:
die : str
bank: str
pins: set = None # None means all pins; otherwise a set like {"A5","A6","B0"}
pins: Optional[FrozenSet[str]] = None # None means all pins; otherwise a set like {"A5","A6","B0"}
def __post_init__(self):
if self.pins is not None:
if self.pins is None:
return
if isinstance(self.pins, str):
# Treat a single string as a single pin name, not an iterable of characters
self.pins = frozenset({self.pins})
else:
self.pins = frozenset(self.pins)
@dataclass