Skip to content

Commit c75f1ab

Browse files
committed
cleaning
1 parent a7711c4 commit c75f1ab

File tree

6 files changed

+8
-49
lines changed

6 files changed

+8
-49
lines changed

edg/abstract_parts/AbstractComparator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class VoltageComparator(GeneratorBlock):
3333
tolerance is specified wide enough.
3434
The output is logic high when the input exceeds the trip voltage by default,
3535
this can be inverted with the invert parameter.
36-
Optionally this can take a reference voltage input, otherwise this generates a 1:1
37-
divider by default.
36+
Optionally this can take a reference voltage input, otherwise this generates a divider.
3837
3938
TODO: maybe a version that takes an input analog signal?
4039
"""

edg/abstract_parts/PowerCircuits.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -228,46 +228,3 @@ def contents(self):
228228
'control': DigitalSink(),
229229
'gnd': Ground(),
230230
})
231-
232-
233-
class FetPrecharge(Block):
234-
"""Precharge circuit that limits inrush current with an resistor, then provides low supply impedance
235-
by closing a power FET.
236-
237-
TODO: calculate power rating needed for some capacitance instead of spec'ing for DC"""
238-
@init_in_parent
239-
def __init__(self, *, precharge_resistance: RangeLike = 100*Ohm(tol=0.1),
240-
pull_resistance: RangeLike = 10*kOhm(tol=0.05),
241-
max_rds: FloatLike = 1*Ohm, clamp_voltage: RangeLike = RangeExpr.ZERO):
242-
super().__init__()
243-
self.gnd = self.Port(Ground.empty(), [Common])
244-
self.pwr_in = self.Port(VoltageSink.empty(), [Input, Power])
245-
self.pwr_out = self.Port(VoltageSource.empty(), [Output])
246-
self.control = self.Port(DigitalSink.empty())
247-
248-
self.precharge_resistance = self.ArgParameter(precharge_resistance)
249-
self.pull_resistance = self.ArgParameter(pull_resistance)
250-
self.max_rds = self.ArgParameter(max_rds)
251-
self.clamp_voltage = self.ArgParameter(clamp_voltage)
252-
253-
def contents(self):
254-
super().contents()
255-
256-
self.switch = self.Block(HighSideSwitch(
257-
pull_resistance=self.pull_resistance, max_rds=self.max_rds, clamp_voltage=self.clamp_voltage))
258-
self.connect(self.switch.gnd, self.gnd)
259-
self.connect(self.switch.pwr, self.pwr_in)
260-
self.connect(self.switch.control, self.control)
261-
262-
(self.res_forcein, self.res, self.res_forceout), _ = self.chain(
263-
self.pwr_in,
264-
self.Block(ForcedVoltageCurrentDraw(0*Amp(tol=0))), # current draw modeled by switch
265-
self.Block(SeriesPowerResistor(resistance=self.precharge_resistance)),
266-
self.Block(ForcedVoltageCurrentDraw(
267-
VoltageLink._supply_voltage_range(self.gnd, self.pwr_in) / self.precharge_resistance)),
268-
)
269-
270-
self.merge = self.Block(MergedVoltageSource()).connected_from(
271-
self.switch.output, self.res_forceout.pwr_out
272-
)
273-
self.connect(self.merge.pwr_out, self.pwr_out)

edg/abstract_parts/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from .AbstractPowerConverters import BuckConverter, DiscreteBuckConverter, BoostConverter, DiscreteBoostConverter
7474
from .AbstractPowerConverters import BuckConverterPowerPath, BoostConverterPowerPath, BuckBoostConverterPowerPath
7575
from .PowerCircuits import HalfBridge, FetHalfBridge, HalfBridgeIndependent, HalfBridgePwm, FetHalfBridgeIndependent,\
76-
FetHalfBridgePwmReset, RampLimiter, FetPrecharge
76+
FetHalfBridgePwmReset, RampLimiter
7777
from .AbstractLedDriver import LedDriver, LedDriverPwm, LedDriverSwitchingConverter
7878
from .AbstractFuse import Fuse, SeriesPowerFuse, PptcFuse, FuseStandardFootprint, TableFuse, SeriesPowerPptcFuse
7979
from .AbstractCrystal import Crystal, TableCrystal, OscillatorReference, CeramicResonator

edg/core/Range.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ def __add__(self, other: Union['Range', float]) -> 'Range':
165165
return NotImplemented
166166

167167
def __sub__(self, other: float) -> 'Range':
168-
# Range-range subtract semantics not defined
168+
# Range-range subtract semantics not defined as tolerance handling is not intuitive
169169
if isinstance(other, (float, int)):
170170
return Range(self.lower - other, self.upper - other)
171171
else:
172172
return NotImplemented
173173

174174
def __rsub__(self, other: float) -> 'Range':
175-
# Range-range subtract semantics not defined
175+
# Range-range subtract semantics not defined as tolerance handling is not intuitive
176176
if isinstance(other, (float, int)):
177177
return Range(other - self.upper, other - self.lower)
178178
else:

edg/jlcparts/JlcPartsDiode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def _entry_to_table_row(cls, row_dict: Dict[PartsTableColumn, Any], filename: st
4242
row_dict[cls.REVERSE_RECOVERY] = reverse_recovery
4343

4444
return row_dict
45-
except (KeyError, TypeError, PartParserUtil.ParseError) as e:
45+
except (KeyError, TypeError, PartParserUtil.ParseError):
4646
return None
4747

4848

edg/parts/AnalogSwitch_Nlas4157.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from deprecated import deprecated
2+
13
from ..abstract_parts import *
24
from .JlcPart import JlcPart
35

@@ -49,6 +51,7 @@ def contents(self):
4951
self.assign(self.actual_basic_part, False)
5052

5153

54+
@deprecated("obsolete part")
5255
class Nlas4157(AnalogSwitch):
5356
"""NLAS4157 2:1 analog switch, 1ohm Ron, in SOT-363. OBSOLETE.
5457
Pin compatible with:

0 commit comments

Comments
 (0)