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

NaN treatment #3

Open
jamienoss opened this issue Jan 29, 2018 · 0 comments
Open

NaN treatment #3

jamienoss opened this issue Jan 29, 2018 · 0 comments

Comments

@jamienoss
Copy link
Owner

jamienoss commented Jan 29, 2018

Dedupe NaN conditionals

src

...
if preserve_nan:
        badvals = np.isnan(array_internal)

if nan_treatment == 'fill':
        initially_nan = np.isnan(array_internal)
        array_internal[initially_nan] = fill_value
...

To prevent possible duplicated work when preserve_nan == True and nan_treatment == 'fill' the condtions should be joined:

...
if preserve_nan or nan_treatment == 'fill':
    initially_nan = np.isnan(array_internal)
    if nan_treatment == 'fill':
        array_internal[initially_nan] = fill_value
....

nan_treatment == 'fill'

For nan_treatment == 'fill' in convolve(), since any and all possibel NaN values are removed, the subsequent npy_isnan(val), for example for boundary=None (the default), in the Cython routine boundary_none.pyx can be removed. Removing this is a step closer to removing all conditionals such that vectorization can take place.

@jamienoss jamienoss changed the title Dedup Nan conditionals Dedup NaN conditionals Jan 29, 2018
@jamienoss jamienoss changed the title Dedup NaN conditionals Dedupe NaN conditionals Jan 29, 2018
@jamienoss jamienoss mentioned this issue Jan 29, 2018
10 tasks
@jamienoss jamienoss changed the title Dedupe NaN conditionals NaN treatment Jan 29, 2018
jamienoss pushed a commit that referenced this issue May 24, 2018
Don't serialize format as it is now managed with the fits code
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

1 participant