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

Import Error: epsilon_nondominated #223

Closed
SnuggleBug91 opened this issue Feb 23, 2023 · 8 comments
Closed

Import Error: epsilon_nondominated #223

SnuggleBug91 opened this issue Feb 23, 2023 · 8 comments

Comments

@SnuggleBug91
Copy link

In the section on directed search the following import doesn't work.

'''
from ema_workbench.em_framework.optimization import epsilon_nondominated
'''

This is my first time writting an issue so not sure if you need any more than this.

@quaquel
Copy link
Owner

quaquel commented Feb 24, 2023

Thanks for reporting this issue. You have to be a bit more specific than this. I don't know what you mean with "the section on directed search". It would also help if you can indicate what version of the workbench you are using (print(ema_workbench.__version__)).

@SnuggleBug91
Copy link
Author

SnuggleBug91 commented Feb 24, 2023

Sorry, I wasn't particularly helpful with my comment. Apologies.

The error comes from following the tutorial on the ema workbench website: https://emaworkbench.readthedocs.io/en/latest/indepth_tutorial/directed-search.html

Specifically, when combing multiple runs of optimising by searching over levers then combining the non-dominated solutions into one dataset.

The code block in question is

from ema_workbench.em_framework.optimization import epsilon_nondominated, to_problem

problem = to_problem(model, searchover="levers")
epsilons = [0.05] * len(model.outcomes)
merged_archives = epsilon_nondominated(results, epsilons, problem)

The version of the workbench I'm running is 2.2.1

@EwoutH
Copy link
Collaborator

EwoutH commented Feb 25, 2023

@SnuggleBug91 Could you update to 2.3.0 and see if the bug still persist? I'm not sure, but it might be fixed already in #150.

@omarcastrejon
Copy link

Hi,
Have you found a solution to this issue?
I am having the same problem trying to use epsilon_nondominated. I am using version 2.4.0 of the EMA workbench. Not sure what the problem could be but this is the error I get:
image
Any thoughts?
Thank you in advance.

@quaquel
Copy link
Owner

quaquel commented Jun 17, 2023

There is a fix on master, just need time to cherry-pick al bug fixes since last release to create a new release. You can still install master through pip (check google)

@omarcastrejon
Copy link

@quaquel thank you for your quick reply. I have installed the master version (2.5.0.dev0) but unfortunately I'm still getting an AttributeError and and EMAError (please see below). Any advice would be really appreciated. Thank you.

image

@omarcastrejon
Copy link

omarcastrejon commented Jun 17, 2023

By looking at some documentation on DataFrame.itertuples, itertuples() does not work with column names that include special characters such as spaces, '-', '&', or '.'. My suggestion: either (1) create a note saying that the name of the levers should not include special characters; or (2) use named itertuples() by creating a temporary list of names to iterate over DataFrame rows as namedtuples.

@quaquel
Copy link
Owner

quaquel commented Jun 17, 2023

There is already an open issue for this (#274)

@quaquel quaquel closed this as completed Jun 18, 2023
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

4 participants