ianhbell / binfit Goto Github PK
View Code? Open in Web Editor NEWThe python code for fitting interaction parameters for binary mixtures
The python code for fitting interaction parameters for binary mixtures
Dear Ian,
I was hoping that would please be able to assist me with a small problem I encounter in binary_fitter.py on line 153, namely: "TypeError: can only assign array (not "list") to array slice"
As per your guidelines provided in the repository, after installing Anaconda I can get as far as:
There doesn't seem to be any problem finding os.environ['RPPREFIX'] (...if I print the prefix to the terminal the path is correct), and so I have not needed to un-comment the associated line in the procedure "main" of binary_fitter.py
Below the traceback given by the terminal:
(py3) C:\Users\USERNAME\Desktop\binfit-master>python binary_fitter.py
number of unique T: 33 number of unique x: 82 only_fit_gammaT: False
Traceback (most recent call last):
File "binary_fitter.py", line 489, in <module>
deap_optimizer(collect_binary(lib, ('DECANE','PROPANE')))
File "binary_fitter.py", line 461, in deap_optimizer
timeout = 7200)
File "binary_fitter.py", line 299, in eaSimple
for ind, fit in zip(invalid_ind, fitnesses):
File "C:\Users\USERNAME\AppData\Local\Continuum\anaconda3\envs\py3\lib\site-packages\deap\tools\constraint.py", line 49, in wrapper
return func(individual, *args, **kwargs)
File "binary_fitter.py", line 392, in evalOneMax
err = apply_betagamma(df, parameters, '', Nloops = 100, Npoints_selected = 5, fit_bits = fit_bits)
File "binary_fitter.py", line 176, in apply_betagamma
set_parameters(RP, parameters)
File "binary_fitter.py", line 153, in set_parameters
fij[0:len(parameters)] = parameters
TypeError: can only assign array (not "list") to array slice
If I insert on line 152 of binary_fitter.py the code “print(len(parameters))” I get “5”, and for “print(parameters)” I get “[0.9239701215168029, 3.405018302953891, 1, 1, 0]”
Thanks for making this code available!
Regards,
Jurgen Olivier
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.