ictdesigntools.cabling.assemblies¶
Cable assemblies: a cable type and what is on each end, modelled as NetBox models cables.
An Assembly is a patch cord, a trunk or a breakout. Its profile follows NetBox 4.5's
cable profiles: the connectors on each end and the positions (lanes: a fiber, a pair) on each
connector, written single-1c12p (one 12-position connector each end), trunk-2c1p (two
single-position connectors each end, a duplex LC cord) or breakout-1c8p-8c1p (an MPO-8
fanned out to eight single-position connectors). polarity says which A lane meets which B
lane, by the TIA-568 connectivity types: A straight through, B reversed, C pairs
flipped. A duplex cord made A-to-B is type B (or C, the same for two lanes); an A-to-A cord is
type A. lanes() lists the map, so a path can be traced lane by lane through the cable, as
NetBox traces it.
Ends name a connector from data/connectors.toml with its polish and, for MPO and MMC, its
pins; breakouts carry their legs. spec gives the rows of a spec sheet and bom the lines
of a bill of materials; assembly_drawing draws it with the same connector components the
panels use. Generic assemblies come from data/assemblies.toml (assemblies()).
>>> cord = assembly("lc-lc-duplex-om4-2m")
>>> cord.profile.slug, cord.polarity, [(l.a, l.b) for l in cord.lanes()]
('trunk-2c1p', 'B', [((1, 1), (2, 1)), ((2, 1), (1, 1))])
Profile
dataclass
¶
Connectors and positions on each end, as a NetBox cable profile.
parse
classmethod
¶
A profile from its NetBox slug. Shuffle profiles are not modelled yet: NetBox remaps their positions by its own tables, so they are refused rather than guessed.
Source code in src/ictdesigntools/cabling/assemblies.py
Lane
dataclass
¶
One lane of a cable: (connector, position) on end A, and where it lands on end B.
End
dataclass
¶
label ¶
The plug, its polish and pins: LC/UPC, MPO-8/APC/pinned (a multi-fiber
connector given its positions).
Source code in src/ictdesigntools/cabling/assemblies.py
Legs
dataclass
¶
A breakout's legs: where the cable fans out, how long each leg is, and the stagger between successive legs (0 for even legs).
Assembly
dataclass
¶
Assembly(
name: str,
type: str,
profile: Profile,
a: End,
b: End,
length: float,
length_unit: str = "m",
polarity: str = "A",
legs: Legs | None = None,
label: str = "",
color: str = "",
cable: str = "",
part_number: str = "",
slug: str = "",
source: str = "",
problems: tuple[str, ...] = (),
)
A cable assembly, with NetBox's cable field names where NetBox has them (type,
length, length_unit, label, color, profile).
end_label ¶
A or B: how many of which plug, as 8 × LC/UPC.
Source code in src/ictdesigntools/cabling/assemblies.py
lanes ¶
Each lane from end A to end B, by the profile and the polarity: lanes are counted connector by connector, position by position, on both ends; type A keeps the count, type B reverses it, type C swaps each pair.
Source code in src/ictdesigntools/cabling/assemblies.py
assemblies
cached
¶
The generic assemblies in data/assemblies.toml, by slug.
spec ¶
The rows of a spec sheet, as (field, value).
Source code in src/ictdesigntools/cabling/assemblies.py
bom ¶
Bill of materials lines: one per distinct assembly, with its count (see BOM_HEADER).
Source code in src/ictdesigntools/cabling/assemblies.py
assembly_drawing ¶
The assembly from the side, cable length not to scale: end A's connectors on the left, the cable, and end B's connectors (on legs from the breakout for a breakout) on the right, the length dimensioned, and the lane map under it.
detail="detailed" draws each plug from parts.plugs at 1:1 (its housing in the
TIA-568 colour for the cable type and polish) with each end's mating face enlarged below,
fiber positions numbered; "simple" draws plain bodies with the panel footprints.
Source code in src/ictdesigntools/cabling/assemblies.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 | |