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

Make Sciunit Optimize a method of NU test. #225

Open
russelljjarvis opened this issue Aug 2, 2019 · 3 comments
Open

Make Sciunit Optimize a method of NU test. #225

russelljjarvis opened this issue Aug 2, 2019 · 3 comments
Assignees

Comments

@russelljjarvis
Copy link
Contributor

Make Sciunit Optimize a method of NU test.

This would mean creating a method inside the NU test class init.py or base.py of NU test class.

@rgerkin
Copy link
Contributor

rgerkin commented Aug 7, 2019

Much like there is test.judge(model), there should be test.optimize(model), at least for those test classes which support it (i.e. which have an optimization framework). This could be done via an Optimizable mix-in, e.g.:

class Optimizable:
   def optimize(self, model, **kwargs):
      [code here]

And then e.g. VmTest could have its signature redefined from class VmTest(sciunit.Test) to class VmTest(sciunit.Test, Optimizable).

@russelljjarvis
Copy link
Contributor Author

russelljjarvis commented Oct 27, 2019

I seem to have misunderstood the intention the first time I read this. What I did do instead is make a new test class that inherits from python dictionaries, and then make optimize a method of this new abstract dictionary. To meet your desired specifications, would require more work. I believe the feature is a type of syntactic sugar. I don't think we should be held up by it, as I don't think its critical for delivering a product.

https://github.com/russelljjarvis/neuronunit/blob/master/neuronunit/optimisation/optimization_management.py#L111-L127

@rgerkin
Copy link
Contributor

rgerkin commented Oct 28, 2019

Right, I think it can be part of a later refactoring step.

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

No branches or pull requests

2 participants