smiths / caseStudies

Case studies of (manual) documentation for scientific computing software
3 stars 2 forks source link

ZeroDivisionError in Python_Simplified #78

Closed samm82 closed 6 years ago

samm82 commented 6 years ago

Running make in Python_Simplified results in the following error:

Traceback (most recent call last):
  File "C:\Users\samcr\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\samcr\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\samcr\Desktop\Summer Research\caseStudies\CaseStudies\glass\Implementations\Python_Simplified\Implementation\mainfun.py", line 47, in <module>
    main(filename)
  File "C:\Users\samcr\Desktop\Summer Research\caseStudies\CaseStudies\glass\Implementations\Python_Simplified\Implementation\mainfun.py", line 33, in main
    q_hat = calculations.calc_q_hat(q, params)
  File "C:\Users\samcr\Desktop\Summer Research\caseStudies\CaseStudies\glass\Implementations\Python_Simplified\Implementation\calculations.py", line 14, in calc_q_hat
    q_hat = q * pow((params.a * params.b), 2) / (params.E * pow(params.h, 4)) * (1 / params.gtf)
ZeroDivisionError: float division by zero
Wrong thickness entered -Not an industrial standard
make: *** [prog] Error 1
smiths commented 6 years ago

Can you provide more information? What value is zero? param.gtf? Is the ZeroDivisionError caused by the Wrong thickness error? If the thickness isn't assigned, it is probably params.h that is zero. I suggest you fix the thickness input and see what that does to the test cases.

samm82 commented 6 years ago

Apparently I just missed an input file on #76

smiths commented 6 years ago

Glad this was sorted out relatively painlessly. 😄