-
Notifications
You must be signed in to change notification settings - Fork 840
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
Dictionary parameters fix #309
Conversation
I wonder if it would be better to make the arguments more explicit rather than making an exception for a specific set of types (Mapping types). With the current code the issue could be solved on the user's part by passing What if instead the BatchRunner took two arguments, static_parameter_values and variable_parameter_values, where the second argument is explicitly required to be a mapping of |
@njvrzm I guess you're right, it would be better. Actually, I was only thinking about case with mappings because directly faced with difficulties arising from absence of this functionality. And right now it looks quite cumbersome because it is not make too much sense to use static param in Though there is still a question how to present results. I mean, the data frame that collects statistics uses passed arguments as keys. So there is also a question how to report this result with static params, i.e. is it worth to exclude them from data frame or maybe somehow "flatten" static argument to fit into data frame columns. Anyway, I'll try to do it somehow. |
(sorry for the delay of my chime in... I have one more component to my Ph.D exam that wraps up today --- I will catch up after that.) |
Bringing this back up... |
@jackiekazil I think that maybe I should refactor this part in a way that @njvrzm proposed. So if you think it is worth to do, I can proceed as he suggested to make it more general. |
I'd be happy to help out if you like, @devforfu. (Also it occurred to me while looking over this again that "fixed_parameter_values" is probably a better name than "static...".) |
Sorry for late response, here an updated version: @njvrzm, do you think it is what you've meant? I've attempted to separate fixed and variable parameters and also handle case if the last argument is not a **kwargs. Not sure if it is needed thought. |
Also I though about something like |
- Some common functionality factored out into separate method - New mock model for test suit - A default list argument in StagedActivation init replaced with None
Slightly adjusted runner and tests. Also could someone tell me please, is it an intentional decision to use |
@devforfu re |
Thanks for this and sorry I haven't had a chance to review it yet! I will do so this weekend. |
@dmasad That's right, asserts are quite clear way to express test cases I guess. The only issue that default Python test runner doesn't explain what is going wrong when assert failed. class TestSomething(unittest.TestCase):
def test_something_failed_with_plain_assert(self):
x = 1
y = 2
assert x == y
def test_something_failed_with_unittest_assert(self):
x = 1
y = 2
self.assertEqual(x, y) And here is an output:
You see that the last one, I mean, "dedicated" And as a side note, probably you know, there is a @njvrzm Sure, no problem, thank you! |
I'm merging this into a new branch so I can do some cleanup before merging into master. I'll make a new PR for that shortly! |
Here is an attempt to fix dictionary parameters issue #307 . Not sure if it covers all possible cases and the resulting dataframe with report contains frozen sets as keys. So probably there is another way to fix this issue in more clear way, i.e. to make more adjustments into batch processing code fragment.