Skip to content
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

Dealing with trailing whitespace #52

Closed
kadrlica opened this issue Jan 21, 2016 · 9 comments
Closed

Dealing with trailing whitespace #52

kadrlica opened this issue Jan 21, 2016 · 9 comments

Comments

@kadrlica
Copy link
Collaborator

This is an issue created for our fairly extensive discussion of how CFITSIO, fitsio, and pyfits treat trailing whitespace in binary tables.

I think the working suggestion is to replace leading/trailing whitespace characters with null characters when writing FITS files. This is something that will need to be done in pandas/numpy before passing to fitsio for writing.

CFITSIO Manuel:
https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node24.html

@mgckind
Copy link
Owner

mgckind commented Jan 21, 2016

Thanks, I was about to create this. And also the other way around in case when reading fits files to uploading them.

@kadrlica
Copy link
Collaborator Author

Is there any time we want to respect trailing whitespace?

@mgckind
Copy link
Owner

mgckind commented Jan 21, 2016

I want to believe there isn't. we can enforce that as well.

@kadrlica
Copy link
Collaborator Author

We could provide a toggle switch (i.e., easyaccess -w) that respects whitespace.

@mgckind
Copy link
Owner

mgckind commented Jan 21, 2016

and the default being not to respect, I'd use a flag like --enable-white-space to create consciousness while typing

@kadrlica
Copy link
Collaborator Author

I think the Oracle TRIM function is what we are looking for here. I've done some timing tests, and it looks like prepending TRIM when inserting string values has the desired effect and does not adversely impact the performance. Specifically, the implementation would be to apply

TRIM(TRAILING FROM :value)

in easy_or.insert_data for string columns.

http://www.techonthenet.com/oracle/functions/trim.php

@mgckind
Copy link
Owner

mgckind commented Apr 21, 2016

Was this incorporated in #56 ?

@mgckind
Copy link
Owner

mgckind commented Apr 21, 2016

Yes, I saw it. Closing

@mgckind mgckind closed this as completed Apr 21, 2016
@kadrlica
Copy link
Collaborator Author

Yep, should be in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants