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

RestrictionRange not working as intended #4

Open
JCoetzee123 opened this issue Jul 24, 2019 · 0 comments
Open

RestrictionRange not working as intended #4

JCoetzee123 opened this issue Jul 24, 2019 · 0 comments

Comments

@JCoetzee123
Copy link
Contributor

Title

spira.core.parameters.restrictions not working as intended

Steps to reproduce:

  1. Import required parts of the SPiRA framework
import spira.all as spira
  1. Create a class excepting a spira.ParameterInitializer parameter and a range restriction
class Layer(spira.ParameterInitializer):
    range_int = spira.IntegerParameter(restriction=spira.RestrictRange(lower=1, upper=5))
  1. Initialize Layer class in main script and assign invalid value
layer = Layer()
layer.range_int  = 11

Expected behavior (correct)

Error: ValueError, 11 not in range of 5

Current behavior (incorrect)

[SPiRA] Version 0.1.1-Auron [Beta] - MIT License

Possible fixes

Changes made to variables.py to correct logic error.

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

1 participant