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 type annotations #244

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
50143e5
Add type-annotations to Runner
basnijholt Oct 12, 2022
6cf01d8
Add type-hints to adaptive/_version.py
basnijholt Oct 12, 2022
1786f80
Add type-hints to adaptive/learner/__init__.py
basnijholt Oct 12, 2022
9490093
Add type-hints to adaptive/learner/balancing_learner.py
basnijholt Oct 12, 2022
6b3209f
Add type-hints to adaptive/learner/base_learner.py
basnijholt Oct 12, 2022
8363aa6
Add type-hints to adaptive/learner/data_saver.py
basnijholt Oct 12, 2022
2b0497f
Add type-hints to adaptive/learner/integrator_coeffs.py
basnijholt Oct 12, 2022
c2b6cf3
Add type-hints to adaptive/learner/integrator_learner.py
basnijholt Oct 12, 2022
3293f60
Add type-hints to adaptive/learner/learner2D.py
basnijholt Oct 12, 2022
2b5e0d1
Add type-hints to adaptive/learner/learnerND.py
basnijholt Oct 12, 2022
08ddfb2
Add type-hints to adaptive/learner/sequence_learner.py
basnijholt Oct 12, 2022
5d8110f
Add type-hints to adaptive/learner/skopt_learner.py
basnijholt Oct 12, 2022
7fd0588
Add type-hints to adaptive/learner/triangulation.py
basnijholt Oct 12, 2022
2e0efc1
Add type-hints to adaptive/notebook_integration.py
basnijholt Oct 12, 2022
96e186f
Add type-hints to adaptive/tests/algorithm_4.py
basnijholt Oct 12, 2022
ec3649a
Add type-hints to adaptive/tests/test_average_learner1d.py
basnijholt Oct 12, 2022
54265bb
Add type-hints to adaptive/tests/test_learner1d.py
basnijholt Oct 12, 2022
9e52ecb
Add type-hints to adaptive/tests/test_learners.py
basnijholt Oct 12, 2022
b4ba66e
Add type-hints to adaptive/types.py
basnijholt Oct 12, 2022
3928c3d
Add type-hints to adaptive/utils.py
basnijholt Oct 12, 2022
95cc29b
Add type-hints to setup.py
basnijholt Oct 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add type-hints to adaptive/notebook_integration.py
basnijholt committed Oct 12, 2022
commit 2e0efc1b6abc3b01f57a998844ec93a78b2f814a
4 changes: 3 additions & 1 deletion adaptive/notebook_integration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import asyncio
import datetime
import importlib
@@ -76,7 +78,7 @@ def ensure_plotly():
raise RuntimeError("plotly is not installed; plotting is disabled.")


def in_ipynb():
def in_ipynb() -> bool:
try:
# If we are running in IPython, then `get_ipython()` is always a global
return get_ipython().__class__.__name__ == "ZMQInteractiveShell"