0

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?

asked Jun 15, 2022 at 12:46
2
  • Can you show the full traceback error? Commented 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. Commented Jun 16, 2022 at 8:03

1 Answer 1

0

@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'
answered Jun 16, 2022 at 7:35
Sign up to request clarification or add additional context in comments.

1 Comment

Please answer comment with another comment and add traceback to the question itself.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.