Code Monkey home page Code Monkey logo

binfit's People

Contributors

ianhbell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

binfit's Issues

Type Error in binary_fitter.py :: Can only assign array (not "list") to array slice

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:

  1. Creating new environment "py3", and loading pandas, numpy, and scipy into this environment,
  2. Activating the newly created py3 in the Anaconda terminal,
  3. Next I can: pip install deap, CoolProp, xlrd, ctRefprop,
  4. Then I add an extra step to change the directory in the terminal to the folder where I keep all the files downloaded from the repository (cd C:\Users\USERNAME\Desktop\binfit-master),
  5. Then I call binary_fitter.py from the terminal, which runs to line 153 before hitting the error described above (please see traceback below for more information)?

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.