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

Defer import of aio_pika #295

Closed
wants to merge 2 commits into from

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Dec 11, 2024

Replace #287

(I'll do a benchmark on import aiida.orm with this)

@unkcpz unkcpz force-pushed the wrap-aio-pika-exceptions branch 2 times, most recently from 2eb7194 to 170f1f9 Compare December 11, 2024 11:16
@unkcpz unkcpz force-pushed the wrap-aio-pika-exceptions branch from 170f1f9 to f7427e0 Compare December 11, 2024 11:18
@unkcpz
Copy link
Member Author

unkcpz commented Dec 11, 2024

I didn't detect any import performance improvement, maybe I did something wrong? @danielhollas

I run:

hyperfine -w 5 'python -c "import aiida.orm"'

@sphuber
Copy link
Collaborator

sphuber commented Dec 11, 2024

I didn't detect any import performance improvement, maybe I did something wrong? @danielhollas

I run:

hyperfine -w 5 'python -c "import aiida.orm"'

Well, you now add the imports to plumpy.exceptions and that is star-imported in plumpy/__init__.py so you are undoing moving the import in plumpy.processes are you not?

@unkcpz unkcpz force-pushed the wrap-aio-pika-exceptions branch from 103943b to 1997185 Compare December 11, 2024 12:51
@unkcpz
Copy link
Member Author

unkcpz commented Dec 11, 2024

plumpy.exceptions and that is star-imported in plumpy/init.py

Right, that's true. But it is not easy to seperate the aiopika exception from the regular exceptions. I create and rmq module for that but it seems a bit overkill.
I am working on adding support for not using rabbitmq, and in the end I think it should have plumpy to support both. A good start would to have a module for things that related to rabbitmq related libraries (aio_pika, kiwipy..).

@unkcpz
Copy link
Member Author

unkcpz commented Dec 12, 2024

I'll include this in #297, since this is not urgent fix.

@unkcpz unkcpz closed this Dec 12, 2024
@unkcpz unkcpz deleted the wrap-aio-pika-exceptions branch December 12, 2024 11:14
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

Successfully merging this pull request may close these issues.

2 participants