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

[Question] non inclusive float parameter #127

Open
pmatos opened this issue Dec 4, 2018 · 1 comment
Open

[Question] non inclusive float parameter #127

pmatos opened this issue Dec 4, 2018 · 1 comment

Comments

@pmatos
Copy link

pmatos commented Dec 4, 2018

Is there a way to define a FloatParameter where the min is not inclusive? For example, a FloatParameter between 0 and 1, but different than 0, i.e. an x where 0 < x <= 1?

@jansel
Copy link
Owner

jansel commented Dec 5, 2018

You could subclass FloatParameter to create such a parameter. An easier way might be way might be to replace (0, 1) with (sys.float_info.min, 1). (A double can't represent any numbers between 0 and sys.float_info.min so this would be the same as what you are asking for.)

https://docs.python.org/3/library/sys.html#sys.float_info

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

2 participants