You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class SomeClass
@ureg.check(None, None,
'[length] ** 2 / [time]',
)
def __init__(self, name='test',
D_s=2.4e-15 * ureg('m ** 2 / s'),
):
print D_s
self.name = name
@ureg.check(None, None, None, '=A/A') # this is a hack for dimensionless
def testFunc(self, name='aaa',
Kf=300. * ureg('(g/g_substrate)*(L/g) ** 0.3'),
n_inv=0.3 * ureg.dimensionless):
print self
print name
print Kf
print n_inv
when I create some instance of the class,
some_instance = SomeClass()
it fails with the error:
File "C:\Users\korevma\AppData\Local\Continuum\Anaconda2\lib\site-packages\pint\registry_helpers.py", line 210, in wrapper
if dim and value.dimensionality != dim:
AttributeError: 'NoneType' object has no attribute 'dimensionality'
When I remove the check for the init() and then run the testFunc()
some_instance.testFunc()
no errors are returned. What am I doing wrong
The text was updated successfully, but these errors were encountered:
Say I have this class:
when I create some instance of the class,
it fails with the error:
When I remove the check for the init() and then run the testFunc()
no errors are returned. What am I doing wrong
The text was updated successfully, but these errors were encountered: