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

Add helper function for running async coroutines under existing event loop #69

Merged
merged 2 commits into from
Aug 29, 2023

Conversation

nikosavola
Copy link
Member

This PR adds a helper function called run_async_with_event_loop for running async coroutines in environments such as IPython using nest_async. This fixes #68 and the Elmer notebook output is suppressed to not get incredibly long logs.

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #69 (1b38cff) into main (ff58797) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 57.69%.

@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   42.15%   42.16%   +0.01%     
==========================================
  Files         165      165              
  Lines       10301    10319      +18     
==========================================
+ Hits         4342     4351       +9     
- Misses       5959     5968       +9     
Files Changed Coverage Δ
gplugins/palace/get_capacitance.py 31.16% <50.00%> (-0.89%) ⬇️
gplugins/async_utils.py 80.00% <55.00%> (-20.00%) ⬇️
gplugins/elmer/get_capacitance.py 92.10% <75.00%> (-0.11%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@nikosavola nikosavola force-pushed the 68-asyncio-run-event-loop-one branch from 2af56a2 to 1b38cff Compare August 29, 2023 00:27
@nikosavola nikosavola marked this pull request as ready for review August 29, 2023 01:03
@joamatab joamatab merged commit 48ceb24 into gdsfactory:main Aug 29, 2023
simbilod pushed a commit to simbilod/gplugins that referenced this pull request Sep 9, 2023
…-loop-one

Add helper function for running async coroutines under existing event loop
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.

asyncio.run not working in Elmer example notebook
2 participants