Closed svniemeijer closed 2 years ago
pushed a patch, please review.
btw, note this case, which I also think I fixed with the same patch:
p.foo = harp.Variable(-1000) p.foo.valid_min = -5000 p.foo.valid_max = 1 # less wide type, overrides valid_min type!? test_export(p)
this led to a crash, because in the code valid_max check overrides the valid_min check (I now take the maximum/widest type):
'''
That was indeed also an issue. Things work as expected now.
See #262 for details.
When showing the type of a variable in
__str__()
this should be the same type as would be used in an export. This means that for integers it should take the size of the valid_min/valid_max into account as well (as is done in_export_variable()
).