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

Need Descriptive Error Message when generational_ea() is called without an ops.pool() operator #197

Open
escott-mitre opened this issue May 12, 2022 · 0 comments

Comments

@escott-mitre
Copy link
Contributor

Problem

Issue encountered by @anmol-srivastava-mitre:

Forget to pool, and you are met with a crazy oscure error message about the secret elitist_survival operator that lives inside generational_ea

MWE

ea = generational_ea(
        max_generations=100,
        pop_size=10,
                         
        problem=my_problem,
                         
        representation=my_representation,

        pipeline=[
            ops.tournament_selection,
            ops.clone,
            #
            #
            ops.evaluate
        ]
    )

Expected Behavior

A nice error message to the effect that "Your operator pipeline outputted a generator when it was done, but generational_ea expects to receive the new population as a list. Perhaps you forgot an ops.pool() operator?"

Actual Behavior

ValueError: Operator <function elitist_survival at 0x0000029754CF1900> received a <class 'generator'> as input, but expected a list.
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

1 participant