SciQLop / speasy

Space Physics made EASY! A simple Python package to deal with main Space Physics WebServices (CDA,SSC,AMDA,..)
Other
24 stars 7 forks source link

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

Closed RichardHitier closed 1 year ago

RichardHitier commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

@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.