matplotlib 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '031029dfffd069a1f568a7c371c48eb97e9d58ee1aa5896efabcab3a069d5be1'
4
- data.tar.gz: 067573f2326b54a70cc57758a1b912527971fe35032fa2ec79ee293e2dc2587b
3
+ metadata.gz: 16136e1e95a540d319e3bad7168e37ee5d6207ce8cdd029becc8586cdb696873
4
+ data.tar.gz: d9d5286651db26478890d6e33673b2740fb600a7f9f92190502914438486138e
5
5
  SHA512:
6
- metadata.gz: 104847e206ec576fe12634e872069f30b4be98dbcba8734694efe6b15136209cb9a3a9273ad02b4b311ea33fca14a91b7a024822fda6e1811b61fb9322c0613c
7
- data.tar.gz: d05c2d5ab0bc0b62c5e62b965de47cf5e993f6d5d8bc479a5f7c19e8192010ade144438b322980a273ac76f31ae42a5c1ae8ebc251cc86b169703a84b89be494
6
+ metadata.gz: bf5e6af1f4683a8f547b2371779bbb9e5441f05f8a4cca3b2e5c7f16a628fa1a92e204038125bdf700bf7e922181590a357732140ca9623d30a09885f2efa345
7
+ data.tar.gz: 9f07a63560098806d0c570915daa39bde833713be2568d0bbee79fcd4cd93fa43d8670fc1386ec5b2f03471027c674efecb66cfebe26307f1e108fbe5d6508b1
@@ -65,13 +65,16 @@ module Matplotlib
65
65
  @session.send(:publish, :error, content)
66
66
  end
67
67
 
68
+ unless result.nil? || msg[:content]['silent']
69
+ @session.send(:publish, :execute_result,
70
+ data: ::IRuby::Display.display(result),
71
+ metadata: {},
72
+ execution_count: @execution_count)
73
+ end
74
+
68
75
  trigger_event(:post_execute)
69
76
 
70
77
  @session.send(:reply, :execute_reply, content)
71
- @session.send(:publish, :execute_result,
72
- data: ::IRuby::Display.display(result),
73
- metadata: {},
74
- execution_count: @execution_count) unless result.nil? || msg[:content]['silent']
75
78
  end
76
79
  end
77
80
 
@@ -211,13 +214,24 @@ module Matplotlib
211
214
  # Temporally monky-patching IRuby kernel to enable flushing and closing figures.
212
215
  # TODO: Make this feature a pull-request for sciruby/iruby.
213
216
  kernel = ::IRuby::Kernel.instance
214
- kernel.extend HookExtension
217
+ kernel.extend HookExtension unless kernel.respond_to?(:events)
215
218
  if backend == GUI_BACKEND_MAP[:inline]
216
- kernel.register_event(:post_execute, method(:flush_figures))
219
+ if kernel.respond_to?(:register_event)
220
+ kernel.register_event(:post_execute, method(:flush_figures))
221
+ else
222
+ @post_execute_func = kernel.events.register(:post_execute, &method(:flush_figures))
223
+ end
224
+
217
225
  # TODO: save original rcParams and overwrite rcParams with IRuby-specific configuration
218
226
  new_backend_name = :inline
219
227
  else
220
- kernel.unregister_event(:post_execute, method(:flush_figures))
228
+ if kernel.respond_to?(:unregister_event)
229
+ kernel.unregister_event(:post_execute, method(:flush_figures))
230
+ elsif @post_execute_func
231
+ kernel.events.unregister(:post_execute, @post_execute_func)
232
+ @post_execute_func = nil
233
+ end
234
+
221
235
  # TODO: restore saved original rcParams
222
236
  new_backend_name = :not_inline
223
237
  end
@@ -242,10 +256,7 @@ module Matplotlib
242
256
  kernel = ::IRuby::Kernel.instance
243
257
  gcf.get_all_fig_managers.each do |fig_manager|
244
258
  data = ::IRuby::Display.display(fig_manager.canvas.figure)
245
- kernel.session.send(:publish, :execute_result,
246
- data: data,
247
- metadata: {},
248
- execution_count: kernel.instance_variable_get(:@execution_count))
259
+ kernel.session.send(:publish, :display_data, data: data, metadata: {})
249
260
  end
250
261
  ensure
251
262
  unless gcf.get_all_fig_managers.nil?
@@ -1 +1 @@
1
- MATPLOTLIB_VERSION = "1.1.0"
1
+ MATPLOTLIB_VERSION = "1.2.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matplotlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-10 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pycall
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
131
  requirements: []
132
- rubygems_version: 3.0.6
132
+ rubygems_version: 3.2.3
133
133
  signing_key:
134
134
  specification_version: 4
135
135
  summary: matplotlib wrapper for Ruby