[Discussion] Make has_lengthscale an attr rather than kwarg
See original GitHub issueCurrently 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:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.
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 thekwargs
sounds like a good thing to do for the next release.