-
Notifications
You must be signed in to change notification settings - Fork 4
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
added boolean %b to headers for MADNG output #124
Conversation
I'm away and can't check right now but what happens when this is given to One of the important points of I imagine this would be a problem for If my suspicion above is true, then at the very least I recommend that you add in this PR a warning logged when writing out a |
assert df.headers['BOOLTRUE1'] == True | ||
assert df.headers['BOOLTRUE2'] == True | ||
assert df.headers['BOOLTRUE3'] == True | ||
assert df.headers['BOOLFALSE1'] == False | ||
assert df.headers['BOOLFALSE2'] == False | ||
assert df.headers['BOOLFALSE3'] == False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these should be is True
and is False
.
Regarding @fsoubelet 's comment: I think MAD-NG is actually coming, so we need to adapt to it. Didn't we discuss something like a switch |
I agree with @JoschD. Madng is slowly being used and tested, and it will probably replace PTC for normal form/rdt use cases quite soon. Small packages like tfs-pandas should be adapted to help any transition. The "madx" switch could be a good option indeed. Also, I'm not a fan of a warning. Looks like pythonic madx.. |
Then this could be the opportunity for a few PRs before the next release (taking care of #104 in the same go for instance). I like a switch that would default to
We can log and raise an error if we feel like this is the best option, I was merely suggesting ;) |
I would just adapt the "validate" function and the validate-switch, such that you can turn it on/off as before but also give it as "MAD-NG" or "MAD-X" and it checks for different things. Would be a minor change in that regard. The big change would be to always convert to the new datatypes |
development continued in https://github.com/pylhc/tfs/tree/madng |
Added boolean %b to headers since MADNG is using it in its twiss files. Added test in reader as well. Only for headers at the moment, since there is no usecase yet for boolean columns