MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _num

Function _num

SLiCAP/schematic/component_item.py:99–103  ·  view source on GitHub ↗
(s, default)

Source from the content-addressed store, hash-verified

97 texts: list[dict] = []
98
99 def _num(s, default):
100 try:
101 return float(s)
102 except (TypeError, ValueError):
103 return default
104
105 def _attr(attrs: str, name: str, default: float) -> float:
106 m = re.search(rf'{name}\s*=\s*"([^"]*)"', attrs)

Callers 1

_attrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected