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

Default validator #64

Closed
damazter opened this issue Mar 28, 2016 · 7 comments
Closed

Default validator #64

damazter opened this issue Mar 28, 2016 · 7 comments

Comments

@damazter
Copy link
Contributor

The parameter class at this point, uses Numbers() as its default validator.
I think it would be better, as a default, to use Anything()

What do you all think?

@AdriaanRol
Copy link
Contributor

I think that the standard parameter class should be as general as possible, and therefore not include any assumptions on the input data, I think having Anything() as default validator makes sense.

@alexcjohnson
Copy link
Contributor

I'm not sure. Currently our data storage assumes all set and measured parameters will be numbers, and I think it will break if non-numeric data comes in, so I would kind of like it if you have to actively declare non-numeric valid inputs.

@AdriaanRol
Copy link
Contributor

Group decission pending.

Arguments for vals.Nothing() as default validator

@damazter
Copy link
Contributor Author

Not vals.Anything () ?

On 15 Jul 2016 11:01, "Adriaan" notifications@github.com wrote:

Group decission pending.

Arguments for vals.Nothing() as default validator


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
qdev-dk-archive#64 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AJvAQonywyrwlYr6Zc6-sZrsQFCL1em1ks5qV6CxgaJpZM4H6GWu
.

@alexcjohnson
Copy link
Contributor

I don't like Anything() being the default because it encourages people to not validate input at all. If you want to explicitly say that, then fine. Also right now DataSet only accepts numbers (for now), so I want it to be explicit if you make a parameter that's not compatible with DataSet.

@damazter
Copy link
Contributor Author

I see your point, but I think I do not agree.
(Well vals.Nothing is better than vals.Anything)

I ended up worth a lot of parameters that take string Values. You can not
sweep them, but they are logged just fine.

The reason I promote .Anything is that the default domain of a mathematical
function is always the largest thing that makes sense. Also in computer
programming I learned that validations must be chosen such that they are
never too restrictive.

I see that there are distances between this and qcodes, but this is my 2
cents anyway.

But as said, I like "Nothing" more than "Numbers"

On 15 Jul 2016 11:56, "alexcjohnson" notifications@github.com wrote:

I don't like Anything() being the default because it encourages people to
not validate input at all. If you want to explicitly say that, then fine.
Also right now DataSet only accepts numbers (for now), so I want it to be
explicit if you make a parameter that's not compatible with DataSet.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
qdev-dk-archive#64 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AJvAQsYsUBLZ04xJbbXMDDDwdk1v0Ra5ks5qV63FgaJpZM4H6GWu
.

@giulioungaretti
Copy link
Contributor

I think Number() is the sanest because the default is not the most general case but rather the most idiot proof //simple case.

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

No branches or pull requests

4 participants