-
Notifications
You must be signed in to change notification settings - Fork 66
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
Is there an option for not converting numbers to numeric types when reading idfs? #438
Comments
off the top of my head, I am not seeing a way to have all fields be strings. My recollection is that eppy looks at the IDD file and does the conversion as soon as it read the IDF file. I understand your problem. The floating points make the comparison unstable. There is a use case here that may be worth pursuing. Do you have some pseudo-code on how you want to do the comparison ? |
Thanks for the reply, nothing urgent really, I was more to check if I have missed anything. I was just doing something like `if this_obj == that_obj' through a loop, the context, if interested, was to find the common objects from several idfs with different ventilation settings to automatically make macro parameters. I will probably read the idfs as plain text to do the comparison for now. Speaking of which, does eppy store the raw object as a string attribute before parsing? That is something like |
Actually, I just had a closer look and found that there is an internal argument def idfreader1(fname, iddfile, theidf, conv=True, commdct=None, block=None): All needed here is to expose this argument to |
ha! i tried something else:
prints out
Does this give you options? PS: I have not read you previous comment in detail. Our comments crossed each other :-) |
responding to your comment on setting Yes that will break a lot of things. the question is - how to expose that functionality in an intuitive way. |
Re the first reply, I had a script to remove comments and convert multi-line objects into single lines, which achieved similar outputs to yours. I was not aware of the Re the second, we could simply add |
on I see how **kwargs can do the trick. For both Most of eppy is very intuitive. Then we have these hidden functionality :-( Lets hold off on this for some time. It is not mission critical yet. Close the issue if you want to. |
Don't mind keeping this open. |
Btw, I was curious why the number conversion was embedded in the first place? I understand it may be just a design decision that can be traced back to long ago, but it seems that there is a good side to remain string for everything by default (e.g. consistency before and after eppy processing), and only do the conversion in those calculation functions ad hoc. |
This is very old code - possibly coming from before it became eppy. I don't have a clear recollection of why it was done that way. |
Hi, is there a way to tell eppy to treat all fields as string when reading idfs (perhaps internally)?
I needed to do a lot of object-wise comparisons between different idfs, float numbers always have a precision issue in such case, hence not reassuring.
The text was updated successfully, but these errors were encountered: