File tree Expand file tree Collapse file tree 2 files changed +2
-46
lines changed Expand file tree Collapse file tree 2 files changed +2
-46
lines changed Original file line number Diff line number Diff line change 1
1
module Matplotlib
2
2
class Axes
3
3
include PyCall ::PyObjectWrapper
4
-
5
- @__pyobj__ = PyCall . import_module ( 'matplotlib.axes' ) . Axes
6
-
7
- PyCall . dir ( @__pyobj__ ) . each do |name |
8
- obj = PyCall . getattr ( @__pyobj__ , name )
9
- next unless obj . kind_of? ( PyCall ::PyObject ) || obj . kind_of? ( PyCall ::PyObjectWrapper )
10
- next unless PyCall . callable? ( obj )
11
-
12
- define_method ( name ) do |*args , **kwargs |
13
- PyCall . getattr ( __pyobj__ , name ) . ( *args , **kwargs )
14
- end
15
- end
16
-
17
- class << self
18
- attr_reader :__pyobj__
19
-
20
- def method_missing ( name , *args , **kwargs )
21
- return super unless PyCall . hasattr? ( __pyobj__ , name )
22
- PyCall . getattr ( __pyobj__ , name )
23
- end
24
- end
25
-
26
- PyCall ::Conversions . python_type_mapping ( __pyobj__ , self )
4
+ wrap_class PyCall . import_module ( 'matplotlib.axes' ) . Axes
27
5
end
28
6
end
Original file line number Diff line number Diff line change 1
1
module Matplotlib
2
2
class Axes3D
3
3
include PyCall ::PyObjectWrapper
4
-
5
- @__pyobj__ = PyCall . import_module ( 'mpl_toolkits.mplot3d' ) . Axes3D
6
-
7
- PyCall . dir ( @__pyobj__ ) . each do |name |
8
- obj = PyCall . getattr ( @__pyobj__ , name )
9
- next unless obj . kind_of? ( PyCall ::PyObject ) || obj . kind_of? ( PyCall ::PyObjectWrapper )
10
- next unless PyCall . callable? ( obj )
11
-
12
- define_method ( name ) do |*args , **kwargs |
13
- PyCall . getattr ( __pyobj__ , name ) . ( *args , **kwargs )
14
- end
15
- end
16
-
17
- class << self
18
- attr_reader :__pyobj__
19
-
20
- def method_missing ( name , *args , **kwargs )
21
- return super unless PyCall . hasattr? ( __pyobj__ , name )
22
- PyCall . getattr ( __pyobj__ , name )
23
- end
24
- end
25
-
26
- PyCall ::Conversions . python_type_mapping ( __pyobj__ , self )
4
+ wrap_class PyCall . import_module ( 'mpl_toolkits.mplot3d' ) . Axes3D
27
5
end
28
6
end
You can’t perform that action at this time.
0 commit comments