Closed elmbeech closed 2 months ago
This is a nice example of how such a trivial thing (conceptually) can be tricky. What is a valid string representation of an integer? Based on your fix, this would fail "1e6". Personally, I'd consider that value to be an integer. Unrelated to that type of test, doesn't your "re" check allow for alpha chars in the string, e.g., "42o"? And doesn't this pass your test: "1-2"?
What would you think of something like this as a fix to check for an integer value in a string, sval?
try:
if abs(float(sval) - int(float(sval))) < 1.e-6:
continue
else:
notify user
except:
notify user
I am fine with the test you suggest too! There are many ways leading to Roma. I just need the possibility to set negative integers.
I went with a better fix and committed it. Thanks for discovering this oversight!
small bugfix to be compatible with the underlining PhysiCell patrameter.ints implementation.