question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Discussion] Make has_lengthscale an attr rather than kwarg

See original GitHub issue

Currently has_lengthscale is passed in as an argument to kernels.Kernel. Would this not make more sense as a class attribute which can then be overridden by child classes? I can’t think of situation in which it would make sense to allow a user to specify this via a kwarg…

Example proposed implementation:

class Kernel(...):
    _has_lengthscale = False

class RBFKernel(Kernel):
    _has_lengthscale = True

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
gpleisscommented, Nov 5, 2019

@jahall - we thought about creating a StationaryKernel subclass a while back. Since most of our kernels are stationary we thought it was maybe a bit too much overhead. However, I wouldn’t be opposed to adding it into the library.

1reaction
jacobrgardnercommented, Nov 5, 2019

Yeah, I think this is a good idea. At the moment, a lot of the Kernel kwargs have turned in to a complete mess to be honest. Most of them are absorbed in to **kwargs in a lot of the subclasses, and there are a huge number of them, so converting some of them to attributes and cleaning up the kwargs sounds like a good thing to do for the next release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add support for keyword only arguments · Issue #106 - GitHub
There was a suggestion in #38 that there be an option to make arguments keyword only. The suggested API was to have something...
Read more >
How can you set class attributes from variable arguments ...
You still need to do self.x =kwargs.get'x'] You open yourself up to typos from caller You have to create client with extra chars...
Read more >
attrs by Example - attrs 22.2.0 documentation
If you create an attribute with init=False , the kw_only argument is ignored. ... you can even drop the attrs.field and assign default...
Read more >
A Complete Guide to Data Attributes | CSS-Tricks
Everything you ever wanted to know about data attributes in HTML, CSS, and JavaScript.
Read more >
attr() - CSS: Cascading Style Sheets - MDN Web Docs
The attr() CSS function is used to retrieve the value of an attribute of ... and in particular the characters are used as-is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found