Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Problem with fitness optimizer. #162

Open
mariuszslabicki opened this issue Nov 5, 2015 · 3 comments
Open

Problem with fitness optimizer. #162

mariuszslabicki opened this issue Nov 5, 2015 · 3 comments

Comments

@mariuszslabicki
Copy link

When i try to run code from examples (http://esa.github.io/pygmo/tutorials/analysis_unconstrained_problem.html)

prob = problem.kur(4)
inspector = util.analysis(prob, 500, method='sobol', output_to_file=False)
inspector.f_distribution()
inspector.f_linearity_convexity()
inspector.f_regression(degree=[1,1,2,2,3,3],interaction=[False,True,False,True,False,True])
inspector.f_sensitivity()
inspector.levelset(threshold=45, k_tune=2)
inspector.local_search(clusters_to_show=3, scatter_plot_dimensions=[1,2], algo=algorithm.gsl_nm(), decomposition_method='weighted', weights='uniform')
inspector.f_correlation()

I've got an error:

Traceback (most recent call last):
File "/home/mariusz/Dropbox/SON_research/simulations/comnet_local/main.py", line 309, in
inspector = util.analysis(prob, 500, method='sobol', output_to_file=False)
File "/usr/local/lib/python3.4/dist-packages/PyGMO/util/_analysis.py", line 60, in init
if isinstance(input_object, core._core.population):
NameError: name 'core' is not defined

@mariuszslabicki
Copy link
Author

Yup, i found a solution.

At the top of the file: _analysis.py i had to add (below the line from __future...)

from PyGMO import *

Maybe it can be done nicer, but it works.

@darioizzo
Copy link
Member

as I said its a namespace problem ... import the whole PyGMO its a bit of an overkill .. maybe something like from PyGMO import core would also work?

Thanks for spotting this, I will post a definitive solution for the next release.

@mariuszslabicki
Copy link
Author

Probably you are right, i did not check it.

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

No branches or pull requests

2 participants