I am trying the thermo library in python and want to calculate composition of 'milk of lime' and water however when I run the code below:
from thermo.chemical import Mixture
mix = Mixture(['water', 'Ca(OH)2'], Vfls=[.6, .4], T=300, P=1E5)
print(mix.Cp)
I get following error
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'
When I looked into thermo data it seems like some of the properties for 'Ca(OH)2' is None, am I assuming something wrong in water and 'Ca(OH)2' can be a mixture?
-
Can you show the full traceback error?Cory Kramer– Cory Kramer2022年06月15日 12:57:40 +00:00Commented Jun 15, 2022 at 12:57
-
Honestly, this looks like a library bug to me. I did a bit of digging through its source, but it's a bit cumbersome.Nikolaj Š.– Nikolaj Š.2022年06月16日 08:03:11 +00:00Commented Jun 16, 2022 at 8:03
1 Answer 1
@Cory Kramer
Traceback (most recent call last):
File "path\VLE\chemprop.py", line 49, in <module>
mix = Mixture(['water', 'Ca(OH)2'], Vfls=[.6, .4], T=300, P=1E5)
File "path\Python\Python39\lib\site-packages\thermo\mixture.py", line 608, in __init__
self.zs = Vfs_to_zs(Vfs, Vms_TP)
File "path\Python\Python39\lib\site-packages\chemicals\utils.py", line 1519, in Vfs_to_zs
v = Vfs[i]/Vms[i]
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'
Sign up to request clarification or add additional context in comments.
1 Comment
Nikolaj Š.
Please answer comment with another comment and add traceback to the question itself.
lang-py