Show More
@@ -183,7 +183,7 b' def test_set_matplotlib_formats_kwargs():' | |||||
183 | ip = get_ipython() |
|
183 | ip = get_ipython() | |
184 | cfg = _get_inline_config() |
|
184 | cfg = _get_inline_config() | |
185 | cfg.print_figure_kwargs.update(dict(foo='bar')) |
|
185 | cfg.print_figure_kwargs.update(dict(foo='bar')) | |
186 |
kwargs = dict( |
|
186 | kwargs = dict(dpi=150) | |
187 | display.set_matplotlib_formats('png', **kwargs) |
|
187 | display.set_matplotlib_formats('png', **kwargs) | |
188 | formatter = ip.display_formatter.formatters['image/png'] |
|
188 | formatter = ip.display_formatter.formatters['image/png'] | |
189 | f = formatter.lookup_by_type(Figure) |
|
189 | f = formatter.lookup_by_type(Figure) |
@@ -8,6 +8,8 b' from os import walk, sep, fsdecode' | |||||
8 |
|
8 | |||
9 | from IPython.core.display import DisplayObject, TextDisplayObject |
|
9 | from IPython.core.display import DisplayObject, TextDisplayObject | |
10 |
|
10 | |||
|
11 | from typing import Tuple | |||
|
12 | ||||
11 | __all__ = ['Audio', 'IFrame', 'YouTubeVideo', 'VimeoVideo', 'ScribdDocument', |
|
13 | __all__ = ['Audio', 'IFrame', 'YouTubeVideo', 'VimeoVideo', 'ScribdDocument', | |
12 | 'FileLink', 'FileLinks', 'Code'] |
|
14 | 'FileLink', 'FileLinks', 'Code'] | |
13 |
|
15 | |||
@@ -151,7 +153,7 b' class Audio(DisplayObject):' | |||||
151 | return val |
|
153 | return val | |
152 |
|
154 | |||
153 | @staticmethod |
|
155 | @staticmethod | |
154 | def _validate_and_normalize_with_numpy(data, normalize): |
|
156 | def _validate_and_normalize_with_numpy(data, normalize) -> Tuple[bytes, int]: | |
155 | import numpy as np |
|
157 | import numpy as np | |
156 |
|
158 | |||
157 | data = np.array(data, dtype=float) |
|
159 | data = np.array(data, dtype=float) | |
@@ -170,8 +172,7 b' class Audio(DisplayObject):' | |||||
170 | max_abs_value = np.max(np.abs(data)) |
|
172 | max_abs_value = np.max(np.abs(data)) | |
171 | normalization_factor = Audio._get_normalization_factor(max_abs_value, normalize) |
|
173 | normalization_factor = Audio._get_normalization_factor(max_abs_value, normalize) | |
172 | scaled = data / normalization_factor * 32767 |
|
174 | scaled = data / normalization_factor * 32767 | |
173 |
return scaled.astype( |
|
175 | return scaled.astype("<h").tobytes(), nchan | |
174 |
|
||||
175 |
|
176 | |||
176 | @staticmethod |
|
177 | @staticmethod | |
177 | def _validate_and_normalize_without_numpy(data, normalize): |
|
178 | def _validate_and_normalize_without_numpy(data, normalize): |
@@ -3,7 +3,9 b'' | |||||
3 | ============ |
|
3 | ============ | |
4 |
|
4 | |||
5 | .. _version 7.22: |
|
5 | .. _version 7.22: | |
6 | ================= |
|
6 | ||
|
7 | IPython 7.22 | |||
|
8 | ============ | |||
7 |
|
9 | |||
8 |
|
10 | |||
9 | Thanks |
|
11 | Thanks | |
@@ -16,7 +18,7 b" codebase; they now have triage permissions to the IPython repository and we'll" | |||||
16 | work toward giving them more permission in the future. |
|
18 | work toward giving them more permission in the future. | |
17 |
|
19 | |||
18 | Many thanks to all the contributors to this release you can find all individual |
|
20 | Many thanks to all the contributors to this release you can find all individual | |
19 | contributions to this milestone `on github <https://github.com/ipython/ipython/milestone/XX>`_. |
|
21 | contributions to this milestone `on github <https://github.com/ipython/ipython/milestone/XX>`__. | |
20 |
|
22 | |||
21 | Thanks as well to organisations, QuantStack for working on debugger |
|
23 | Thanks as well to organisations, QuantStack for working on debugger | |
22 | compatibility for Xeus_python, and the `D. E. Shaw group |
|
24 | compatibility for Xeus_python, and the `D. E. Shaw group | |
@@ -53,7 +55,7 b' Thanks' | |||||
53 | ------ |
|
55 | ------ | |
54 |
|
56 | |||
55 | Many thanks to all the contributors to this release you can find all individual |
|
57 | Many thanks to all the contributors to this release you can find all individual | |
56 | contribution to this milestone `on github <https://github.com/ipython/ipython/milestone/83>`_. |
|
58 | contribution to this milestone `on github <https://github.com/ipython/ipython/milestone/83>`__. | |
57 |
|
59 | |||
58 |
|
60 | |||
59 | .. _version 720: |
|
61 | .. _version 720: |
General Comments 0
You need to be logged in to leave comments.
Login now