Skip to content

Commit d0e237d

Browse files
committed
cleaning
1 parent a3610a0 commit d0e237d

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

edg/electronics_model/DigitalPorts.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,13 @@ def contents(self):
7979
self.sinks.sum(lambda x: x.current_draw) + self.bidirs.sum(lambda x: x.current_draw)
8080
)
8181
self.assign(self.current_limits,
82-
self.sources.any_connected().then_else(
83-
self.sources.intersection(lambda x: x.current_limits),
84-
RangeExpr._to_expr_type(RangeExpr.ALL))
82+
self.sources.intersection(lambda x: x.current_limits)
8583
.intersect(self.bidirs.intersection(lambda x: x.current_limits)))
8684
self.require(self.current_limits.contains(self.current_drawn), "overcurrent")
8785

88-
sources_output_thresholds = self.sources.any_connected().then_else(
89-
self.sources.intersection(lambda x: x.output_thresholds),
90-
RangeExpr.ALL * Volt
91-
)
92-
bidirs_output_thresholds = self.bidirs.any_connected().then_else(
93-
self.bidirs.intersection(lambda x: x.output_thresholds),
94-
RangeExpr.ALL * Volt
95-
)
9686
self.assign(self.output_thresholds,
97-
sources_output_thresholds.intersect(bidirs_output_thresholds))
98-
87+
self.sources.intersection(lambda x: x.output_thresholds)
88+
.intersect(self.bidirs.intersection(lambda x: x.output_thresholds),))
9989
self.assign(self.input_thresholds,
10090
self.sinks.hull(lambda x: x.input_thresholds).hull(self.bidirs.hull(lambda x: x.input_thresholds)),
10191
)

0 commit comments

Comments
 (0)