Skip to content

Ensure byte-valued Column inputs to Time are possible. - #6832

Closed
mhvk wants to merge 1 commit into
astropy:masterfrom
mhvk:time-allow-column-unicode-sandwich2
Closed

mhvk wants to merge 1 commit into
astropy:masterfrom
mhvk:time-allow-column-unicode-sandwich2

Conversation

@mhvk

@mhvk mhvk commented Nov 10, 2017

Copy link
Copy Markdown
Contributor

For this purpose, convert all input elements using vectorize rather than nditer, to avoid coercion to arrays and thus allow Column.getitem to do conversion from bytes to string.

This is an alternative to #6823, probably better as less intrusive and more targeted.

This is helpful for #6821.

For this purpose, convert all input elements using vectorize
rather than nditer, to avoid coercion to arrays and thus
allow Column.__getitem__ to do conversion from bytes to string.
@mhvk mhvk added this to the v2.0.3 milestone Nov 10, 2017
@mhvk
mhvk requested a review from taldcroft November 10, 2017 15:58
@astropy-bot

astropy-bot Bot commented Nov 10, 2017 •

Copy link
Copy Markdown

Hi there @mhvk 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃.

Everything looks good from my point of view! 👍

If there are any issues with this message, please report them here.

@mhvk

mhvk commented Nov 10, 2017

Copy link
Copy Markdown
Contributor Author

@taldcroft - on the speed: I checked with a list of 10000 strings, and this PR is about 25% slower than master.

@taldcroft

Copy link
Copy Markdown
Member

on the speed: I checked with a list of 10000 strings, and this PR is about 25% slower than master.

Hmm, that's not quite negligible. It's a bit ugly, but this might be worth two distinct code paths: one which is "faster" and works for unicode and one which does the decoding for bytes input. Again, one knows up front the type of the data.

Or maybe there is a clean way to not lose speed in the default case of unicode inputs?

@mhvk

mhvk commented Nov 10, 2017

Copy link
Copy Markdown
Contributor Author

@taldcroft - I think I now agree with you that my original, more liberal attempt, was better. So, let me close this one...

@mhvk mhvk closed this Nov 10, 2017
@mhvk
mhvk deleted the time-allow-column-unicode-sandwich2 branch December 20, 2018 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants