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

Dynamic inheritance in OptionTrees #796

Merged
merged 9 commits into from
Jul 26, 2016
Merged

Conversation

jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Jul 25, 2016

This PR is primarily to find out whether disabling merge_keywords has an effect on the test. If the tests continue to pass, then I propose keeping it disabled.

Edit: This PR turned into a fix for dynamic inheritance.

@jlstevens
Copy link
Contributor Author

Thanks for that last fix! Hope the tests pass this time...

@jlstevens
Copy link
Contributor Author

The existing tests passed and I am currently adding more unit tests. I should also mention that there is no need to change merge_keywordsand that this PR addresses issue #646.

@jlstevens jlstevens changed the title Disabled merge_keywords on Options Dynamic option inheritance Jul 26, 2016
@jlstevens
Copy link
Contributor Author

I looked into the possibility of defining a utility to replace this code for generating a string specification:

components = (obj.__class__.__name__,
                        group_sanitizer(obj.group),
                        label_sanitizer(obj.label))
 '.'.join([c for c in components if c])

But decided this pattern doesn't appear often enough in the codebase to bother with after grepping for '.'.join(. For tuple specifications, there is already get_spec(obj) which seems sufficient as tuple specs are recommended anyway.

Having added unit tests to ensure the new dynamic inheritance keeps working, I think this PR is now ready for a review/merge.

@jlstevens
Copy link
Contributor Author

I added one more unit test to simulate the %%opts magic. Ready to review/merge.

@jlstevens jlstevens changed the title Dynamic option inheritance Dynamic inheritance in OptionTrees Jul 26, 2016
@jlstevens
Copy link
Contributor Author

I just updated the title of the PR as I confused myself thinking it is about options on DynamicMapinstead of dynamic inheritance!

@philippjfr
Copy link
Member

Thanks for adding the tests. Very happy we finally fixed this.

@philippjfr philippjfr merged commit 25c6c7f into master Jul 26, 2016
@philippjfr philippjfr deleted the disable_merge_keywords branch September 2, 2016 00:57
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

Successfully merging this pull request may close these issues.

None yet

2 participants