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

Dependency injection for external data #3

Closed
perrygeo opened this issue Aug 15, 2014 · 0 comments
Closed

Dependency injection for external data #3

perrygeo opened this issue Aug 15, 2014 · 0 comments

Comments

@perrygeo
Copy link
Owner

Currently, if your objective function relies on any external data it must be defined in the enclosing scope. It would be nice to allow required data to be specified with __init__. Maybe that just means testing and documenting this technique...

class Optimizer(Annealer):
    def __init__(self, state, moredata, extradata):
        self.moredata = moredata
        self.extradata = extradata
        super(Optimizer, self).__init__(state)
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