Skip to content

new implementation of neewd#601

Merged
remicousin merged 5 commits into
masterfrom
newextr
May 4, 2026
Merged

new implementation of neewd#601
remicousin merged 5 commits into
masterfrom
newextr

Conversation

@remicousin
Copy link
Copy Markdown
Contributor

Aaron: FYI since you contributed to this calculation initially.

New implementation divided the length to run the same test by ~3. If approved, will replace in existing function and see the impact on the app.

Xandre, I know you had worked on an alternative implementation, if you share your work, I can have a look at it.

@xchourio
Copy link
Copy Markdown
Contributor

xchourio commented Feb 27, 2026

stress tests and numpy approach .... are pushed in a separate branch master...xc_tests_extrev

Comment thread pepsico/app_calc.py Outdated
Comment thread pepsico/app_calc.py Outdated
@remicousin
Copy link
Copy Markdown
Contributor Author

So, @xchourio , is your function much faster just because it is in numpy?

@xchourio
Copy link
Copy Markdown
Contributor

xchourio commented Mar 6, 2026

Yes, that’s the clue I followed, based on the idea that “if it’s possible to replicate that process with NumPy, NumPy is usually faster.” This is because the labels and objects created during the xarray processes may be slower, since they have to handle additional label, metadata, objects, etc in memory. However, I wasn’t able to replicate the way consecutive days are associated and classified as extreme events

@remicousin
Copy link
Copy Markdown
Contributor Author

Ok. I'll try and write a np function then, but I'll probably use xr.apply_ufunc to wrap it up. It seems you rewrote that part entirely in your case study.

@remicousin
Copy link
Copy Markdown
Contributor Author

Alright. First of all, things are working well with pixi and without dask. Then for this specific function, I tried different things but eventually landed on this proposal. It comes out in an acceptable amount of time now. Can do some more performance optimization later in other PRs.

@remicousin remicousin merged commit fde8256 into master May 4, 2026
1 check passed
@remicousin remicousin deleted the newextr branch May 4, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants