Skip to content

Commit e17c70d

Browse files
committed
SMC - works fine! First test circuit ok
1 parent c509d37 commit e17c70d

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

‎DC_circuits.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# TODO
2525
# change params to **kwargs
2626
# modify classes to support location of label.
27-
#
27+
2828
def example_01(params, ekey, label=True):
2929
# Parameters
3030
V1 = vSource(params['$V_1$'], '$V_1$')

‎ParamSchemDraw.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def resistanceEng(self):
100100
appending the ohms unit and using the significant number of digits
101101
defined when the object was created
102102
'''
103-
return enginnerNotation(self._resistance, resistor.__UNIT, self._digits)
103+
return engineerNotation(self._resistance, resistor.__UNIT, self._digits)
104104

105105
@property
106106
def label(self):
@@ -359,7 +359,7 @@ def voltageEng(self):
359359
appending the volts unit and using the significant number of digits
360360
defined when the object was created
361361
'''
362-
return enginnerNotation(self._voltage, vSource.__UNIT, self._digits)
362+
return engineerNotation(self._voltage, vSource.__UNIT, self._digits)
363363

364364
@property
365365
def label(self):
@@ -448,7 +448,7 @@ def currentEng(self):
448448
appending the volts unit and using the significant number of digits
449449
defined when the object was created
450450
'''
451-
return enginnerNotation(self._current, iSource.__UNIT, self._digits)
451+
return engineerNotation(self._current, iSource.__UNIT, self._digits)
452452

453453
@property
454454
def label(self):
@@ -486,14 +486,14 @@ def isValidISource(I):
486486
return True
487487
return False
488488

489-
def enginnerNotation(value, units="", p=3):
489+
def engineerNotation(value, units="", p=3):
490490
'''
491491
Formats a number to engineering notation using p significant digits,
492492
appending the given unit after the magnitude prefix
493493
494-
USAGE: enginnerNotation(value, units, p)
495-
enginnerNotation(value, units)
496-
enginnerNotation(value)
494+
USAGE: engineerNotation(value, units, p)
495+
engineerNotation(value, units)
496+
engineerNotation(value)
497497
498498
ARGUMENTS:
499499
value -> value to be formatted to enginnering notation
@@ -517,7 +517,7 @@ def enginnerNotation(value, units="", p=3):
517517
assert p >= 1 and p <= 16
518518

519519
# Engineering units prefixes and offset to unitary prefix
520-
_PREFIX = ('$p$', '$n$', '$\mu$', '$m$', "", '$K$', '$M$', '$G$')
520+
_PREFIX = ('p', 'n', '\mu', 'm', "", 'K', 'M', 'G')
521521
_UNIT_OFFSET = 4
522522

523523
# Handling negative numbers and zero

0 commit comments

Comments
 (0)