feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
120 stars 23 forks source link

"Hello world" example doesn't run #66

Closed ianhbell closed 1 year ago

ianhbell commented 2 years ago

The main example in the README doesn't work:

from feos.eos import EquationOfState, State
from feos.pcsaft import PcSaftParameters

# Build an equation of state
parameters = PcSaftParameters.from_json(['methanol'], 'parameters.json')
eos = EquationOfState.pcsaft(parameters)

# Define thermodynamic conditions
critical_point = State.critical_point(eos)

# Compute properties
p = critical_point.pressure()
t = critical_point.temperature
print(f'Critical point for methanol: T={t}, p={p}.')

I think because the path to "parameters.json" is invalid. Looking into the wheel, it looks like the parameter files are not provided with the wheel. Could you please include them with the wheel?

ianhbell commented 2 years ago

In teqp, I provide data files as package data, and a method to get the location of this folder, something similar in feos would be nice.

g-bauer commented 2 years ago

We provide parameter files in this GitHub repo here. Thanks for mentioning it though, we should make it more clear in the example that parameters have to be downloaded separately.

For now, we have deliberately chosen to not provide a parameter data base, because for some substances there exists more than a single parameterization.

ianhbell commented 2 years ago

I agree with your general approach of making the user be thoughtful about what parameters they use. But you could do as I propose, without requiring a checkout of the code and also a pip install of the binaries.