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

Add KernelSpecManager.get_all_specs #93

Merged
merged 5 commits into from
Nov 27, 2015

Conversation

captainsafia
Copy link
Member

Closes #66.

cc/ @minrk @Carreau

"""Returns a :class:`KernelSpec` instance for the given kernel_name.

Raises :exc:`NoSuchKernel` if the given kernel name is not found.
def get_kernel_spec_helper(self, kernel_name, resource_dir):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is IMO misnamed, at least I have trouble seeing this NOT as a function, which gets a helper object, but it returns a kernel spec as far as I see it. So _get_kernel_spec_for_name(name, dir) or _make_kernel_spec(...)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur with what you say, @JanSchulz. Let me update the code.

@jankatins
Copy link

Does this also need a change in the notebook to take advantage of this new thing? [Edit: yes, it also iterates over all kernels: https://github.com/jupyter/notebook/blob/master/notebook/services/kernelspecs/handlers.py#L56]

@captainsafia
Copy link
Member Author

Noted, not sure if it'll be include in the 4.1 release but I don't see any reason as to why it shouldn't.


return self._get_kernel_spec_by_name(kernel_name, resource_dir)

def find_all_specs(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this get_all_specs. That way get_ returns kernelspec objects, while find_ returns locations on disk.

And don't forget to add a docstring.

@minrk minrk changed the title Added find_all_specs Add KernelSpecManager.get_all_specs Nov 27, 2015
@minrk
Copy link
Member

minrk commented Nov 27, 2015

Thanks!

@minrk
Copy link
Member

minrk commented Nov 27, 2015

@captainsafia feel free to ping with a comment when you've addressed notes, so we can review/merge; we don't get notified of new commits, only comments.

Thanks again, this is great!

minrk added a commit that referenced this pull request Nov 27, 2015
Add KernelSpecManager.get_all_specs
@minrk minrk merged commit 40a2338 into jupyter:master Nov 27, 2015
@captainsafia
Copy link
Member Author

Yep! For some strange reason, I thought i had more work to do on this before it was merge ready but if it looks good, sweet!

@captainsafia
Copy link
Member Author

I remember it now. Had to rename the test_find_all_specs to test_get_all_specs but I don't think that's too big a deal.

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.

3 participants