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

How to speedup 'import speasy as spz' ? #56

Closed
RichardHitier opened this issue Oct 14, 2022 · 2 comments · Fixed by #57
Closed

How to speedup 'import speasy as spz' ? #56

RichardHitier opened this issue Oct 14, 2022 · 2 comments · Fixed by #57
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@RichardHitier
Copy link

RichardHitier commented Oct 14, 2022

  • Space Physics WebServices Client version: 1.0.2
  • Python version: 3.8.10
  • Operating System: Ubuntu 20.04.5 LTS

Description

When I use speasy, of course I 'import speasy as spz'
But for tests purpose I run my module very often.
Unfortunately the import line takes much time.

I know it is possible to cache the amda inventory.
Is there a way to allow caching for the whole speasy import ?

What I Did

Read the doc.

@jeandet
Copy link
Member

jeandet commented Oct 14, 2022

@RichardHitier , I agree that speasy import is still too slow.
There is INVENTORIES/cache_retention_days setting but it is ignored when using speasy proxy which might be an issue after all.
I'll check if this speeds up speasy import.

@jeandet jeandet added the enhancement New feature or request label Oct 14, 2022
@jeandet jeandet added this to the 1.0.3 milestone Oct 14, 2022
@jeandet
Copy link
Member

jeandet commented Oct 14, 2022

@RichardHitier can you try PR #57 and see if this is enough for your use case, you can use:

pip install --upgrade git+https://github.com/jeandet/speasy@import_speedup

I think I took most of the low hanging fruits here, I don't think I can get much more speedups since inventories are quite big now and loading them takes quite some time anyway.

@jeandet jeandet self-assigned this Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants