Closed rkingsbury closed 9 years ago
I've traced this to some improperly written conditional statements in the get_amount() method. Since the malfunctioning unit types are listed after the or, they are never property compared with the dimensionality of the input units.
if unit(units).dimensionality == ('[substance]/[length]**3' or '[mass]/[length]**3'):
return moles.to(units,'chem',mw=mw,volume=self.get_volume())
elif unit(units).dimensionality == ('[substance]/[mass]' or '[mass]/[mass]'):
return moles.to(units,'chem',mw=mw,solvent_mass=self.get_solvent_mass())
elif unit(units).dimensionality == ('[mass]'):
return moles.to(units,'chem',mw=mw)
elif unit(units).dimensionality == ('[substance]'):
return moles.to(units)
else:
logger.error('Unsupported unit specified for get_amount')
return None
Fixed in v0.2.2. Closing.
get_amount() fails to return any output when mass/volume or mass/mass units are specified. It works fine with substance/volume, substance/mass, substance, or mass units