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

Incorrect Input File #76

Closed
samm82 opened this issue May 30, 2018 · 3 comments
Closed

Incorrect Input File #76

samm82 opened this issue May 30, 2018 · 3 comments
Assignees

Comments

@samm82
Copy link
Collaborator

samm82 commented May 30, 2018

While working on #68, I came across this: in most, if not all input files, the thickness is given as an integer, eg. "10":

#DIMENSION( length , breadth , thickness in mm)
1600
1500
10

However, it is required that it be described as a float, eg. "10.0":

if not (params.t in ["2.5","2.7","3.0","4.0","5.0","6.0","8.0","10.0","12.0","16.0","19.0","22.0"]):
raise SystemExit("InputError: t must be in [2.5,2.7,3.0,4.0,5.0,6.0,8.0,10.0,12.0,16.0,19.0,22.0]")

else:
print("Wrong thickness entered -Not a industrial standard ")

@smiths
Copy link
Owner

smiths commented May 30, 2018

@samm82 does the test case fail? It seems like it should. I just ran the test case and this failure message comes up many times. The test case is a failure, so this doesn't seem to be a case of testing that the proper exception is generated when expected.

The 10.0 isn't actually a float; it is a string. The 10.0 is a label for a size of glass. Just like a 2 by 4 isn't actually 2 inches by 4 inches, a glass sheet with thickness 10.0 is not actually 10.0 mm. The different thickness of glass is actually an enumerated type, with a finite set of members. It is a number, but it is analogous to if we labelled the glass by its colour (say red glass versus green glass etc.). A string is just a convenient way to read in this information in a text file. If it were a gui, we would have a drop down list, not an edit box. If we had types in Drasil, the thickness would ideally be an enumerated type, not a float, an int or a string.

Can you update the test cases to use the proper ("10.0") input?

@samm82
Copy link
Collaborator Author

samm82 commented May 30, 2018

@smiths So change # to #.0 in all the input files? Is that what you mean by update the test cases?

I realized that "10.0" isn't a float, I just meant that it had a ".0" since "10" ≠ "10.0"

@smiths
Copy link
Owner

smiths commented May 30, 2018

Yes. Please make the change.

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