Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model initialization errors in example notebooks #162

Closed
tkeskita opened this issue Apr 2, 2023 · 5 comments
Closed

Model initialization errors in example notebooks #162

tkeskita opened this issue Apr 2, 2023 · 5 comments

Comments

@tkeskita
Copy link
Contributor

tkeskita commented Apr 2, 2023

Hi,

I'm on Linux, Julia 1.6.7, and installed Clapeyron via Pkg mode add https://github.com/ClapeyronThermo/Clapeyron.jl#master. I tried to follow the example commands in examples/activity_models.ipynb but the model1 line (Wilson model) fails to initialize. The other models seem to initialize OK, though so I wonder what's wrong..?

julia> using Clapeyron, PyCall

julia> import PyPlot; const plt = PyPlot
PyPlot

julia> model1 = Wilson(["water","ethanol"];puremodel=SRK)
ERROR: MethodError: no method matching init_model(::typeof(SRK), ::Vector{String}, ::Vector{String}, ::Bool)
Closest candidates are:
  init_model(::Nothing, ::Any, ::Any, ::Any) at /home/x/.julia/packages/Clapeyron/OnqdP/src/utils/macros.jl:366
  init_model(::Clapeyron.MixingRule, ::Any, ::Any, ::Any, ::Any, ::Any) at /home/x/.julia/packages/Clapeyron/OnqdP/src/models/cubic/mixing/mixing.jl:22
  init_model(::EoSModel, ::Any, ::Any, ::Any) at /home/x/.julia/packages/Clapeyron/OnqdP/src/utils/macros.jl:362
  ...
Stacktrace:
 [1] init_puremodel(model::Function, components::Vector{String}, userlocations::Vector{String}, verbose::Bool)
   @ Clapeyron ~/.julia/packages/Clapeyron/OnqdP/src/models/utility/EoSVectorParam.jl:21
 [2] Wilson(components::Vector{String}; puremodel::Function, userlocations::Vector{String}, pure_userlocations::Vector{String}, verbose::Bool)
   @ Clapeyron ~/.julia/packages/Clapeyron/OnqdP/src/models/Activity/Wilson/Wilson.jl:64
 [3] top-level scope
   @ REPL[4]:1
@tkeskita tkeskita changed the title Wilson model initialization error in examples/activity_models.ipynb Model initialization errors in example notebooks Apr 2, 2023
@tkeskita
Copy link
Contributor Author

tkeskita commented Apr 2, 2023

I'll collect here and update this list of initialization issues I encounter in example notebooks:

  • cubic_eos: VTPR(["carbon monoxide","carbon dioxide"];alpha=BMAlpha)

@longemen3000
Copy link
Member

longemen3000 commented Apr 2, 2023

cubic_eos: VTPR(["carbon monoxide","carbon dioxide"];alpha=BMAlpha)

This one is intended, because VTPR has a defined alpha, but for the sake compatibility i can fix that.

The Wilson error is definitely a bug, and i know why it happens. SRK is not a model, but simply a function that returns an RK model with SoaveAlpha (the same thing would happen if you pass VTPR, that model is a function too that returns a PR model).

@longemen3000
Copy link
Member

@tkeskita hi, did you find any other function?, i wanna make a new release as soon as possible

@longemen3000
Copy link
Member

closed (at least the functions reported here) in 0.4.9

@tkeskita
Copy link
Contributor Author

tkeskita commented Apr 3, 2023

No other findings so far. I'll make a new issue if I find more. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants