sciruby 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: 75215706909588ef2802c12bdf6d118cb479bb77
4
- data.tar.gz: c3d841e10f387587b3381430c32447c5cb00b554
3
+ metadata.gz: 3b252c16326a5fa8636385e42f9d751717e080eb
4
+ data.tar.gz: a34b8dd62f82862746d78ec77d5e63e664b647c0
5
5
  SHA512:
6
- metadata.gz: 76d7cf295cffcdbf903dbab0eed19d9aa2a191d47bfa480229c3b1dac635a8b0b6818fd92405c86d2293c6342426123266241e1d67ecd20c3da10285c52d17ca
7
- data.tar.gz: f83e95db9dd84128c767d8fe5cb8954acfff6d2ff5bd220c300a157869c2c408394bd875c5fa6f59630ceadf13e8c010e4ab103d99ee5108c0cbe8ece5eff7cc
6
+ metadata.gz: 827db23bec2b56a8d459329bb5f198be2870dacb7cceb4330dd7df33153097d6cd6e38ba5fee2c4049b768b3f8cc4e1108d7f63002363452a289b934916fc581
7
+ data.tar.gz: f2c0e6b33df1e80f056da3f3f501a6b3c7308f4c6f41443ebdcb9cc2f57b9926fa9fa1005c350e40a060b294083592f989190d2b37158ac8be6f628e46e6d14a
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ 0.2.3 (2015-06-09)
2
+
3
+ * Simpler SciRuby.gems api
4
+ * Added gems.yml
5
+ * Updated list of sciruby gems
6
+
1
7
  0.2.2 (2015-06-09)
2
8
 
3
9
  * Add SciRuby::Gems and SciRuby.gems
data/Gemfile CHANGED
@@ -1,8 +1,2 @@
1
- $: << File.join(File.dirname(__FILE__), 'lib')
2
- require 'sciruby'
3
-
4
1
  source 'https://rubygems.org'
5
-
6
- SciRuby.gems.all.each do |name, options|
7
- gem name, *options[:version], require: options[:require].first
8
- end
2
+ gemspec name: 'sciruby-full'
data/gems.slim ADDED
@@ -0,0 +1,24 @@
1
+ ruby:
2
+ require 'sciruby'
3
+ doctype html
4
+ html
5
+ head
6
+ title SciRuby gems
7
+ link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"
8
+ body
9
+ h1 SciRuby gems
10
+ table.table.table-striped
11
+ thead
12
+ tr
13
+ th Name
14
+ th Category
15
+ th Description
16
+ th Autoloaded modules
17
+ tbody
18
+ - SciRuby.gems.each_value.sort_by {|gem| gem[:category] }.chunk {|gem| gem[:category] }.each do |cat, gems|
19
+ - gems.sort_by {|gem| gem [:name] }.each do |gem|
20
+ tr
21
+ td = gem[:name]
22
+ td = gem[:category]
23
+ td = gem[:description]
24
+ td = gem[:module].join(', ')
data/gems.yml CHANGED
@@ -1,63 +1,157 @@
1
1
  # Specify all gems which are installed by the `sciruby-full` gem or recommended by the `sciruby` gem.
2
2
 
3
3
  nmatrix:
4
- description: 'Numerical matrix library'
5
- module: [NMatrix, NVector]
4
+ description: Numerics matrix library
5
+ module: [N, NMatrix, NVector]
6
+ category: numerics
7
+
6
8
  gsl-nmatrix:
7
- description: 'Bindings for the GNU scientific library'
9
+ description: Bindings for the GNU scientific library
8
10
  require: gsl
9
11
  module: GSL
12
+ category: numerics
10
13
 
11
14
  rubyvis:
12
- description: 'Plotting library'
15
+ description: Plotting library
16
+ category: plotting
17
+
13
18
  nyaplot:
14
- description: 'Plotting library'
19
+ description: Plotting library
20
+ category: plotting
21
+
15
22
  plotrb:
16
- description: 'Plotting library'
23
+ description: Plotting library
24
+ category: plotting
25
+
17
26
  gnuplot:
18
- description: 'Plotting library'
27
+ description: Plotting library
28
+ category: plotting
19
29
 
20
30
  iruby:
21
31
  module: IRuby
22
- description: 'Ruby kernel for Jupyter'
32
+ description: Ruby kernel for Jupyter
33
+ category: user interface
34
+
23
35
  pry:
24
36
  module: Pry
25
- description: 'Ruby repl'
37
+ description: Ruby repl
38
+ category: user interface
39
+
26
40
  awesome_print:
27
41
  module: ~
28
- description: 'Pretty object printing'
42
+ description: Pretty object printing
43
+ category: utilities
29
44
 
30
45
  daru:
31
- description: 'Dataframe library'
46
+ description: Dataframe library
47
+ category: database
32
48
 
33
49
  integration:
34
- description: 'Numerical integration'
50
+ description: Numerical integration
51
+ category: numerics
52
+
35
53
  minimization:
36
- description: 'Numerical minimization'
54
+ description: Numerical minimization
55
+ category: numerics
56
+
37
57
  distribution:
38
- description: 'Statistical distributions'
58
+ description: Statistical distributions
59
+ category: statistics
39
60
 
40
61
  statsample:
41
- descriptions: 'Statistics'
62
+ description: Statistics
63
+ category: statistics
64
+
42
65
  statsample-glm:
43
- descriptions: 'Statistics'
66
+ description: Statistics
44
67
  module: ~
68
+ category: statistics
69
+
45
70
  statsample-bivariate-extension:
46
- descriptions: 'Statistics'
71
+ description: Statistics
47
72
  module: ~
48
- #statsample-timeseries: # currently not working because of activesupport dependency
49
- # descriptions: 'Statistics'
50
- # module: ~
73
+ category: statistics
74
+
75
+ statsample-timeseries:
76
+ exclude: because of activesupport conflict
77
+ description: Statistics
78
+ module: ~
79
+ category: statistics
80
+
51
81
  extendmatrix:
52
- description: 'Helper methods for Matrix'
82
+ description: Helper methods for Matrix
53
83
  module: ~
84
+ category: numerics
54
85
 
55
86
  publisci:
56
- description: 'Publishing toolkit'
87
+ description: Publishing toolkit
57
88
  module: PubliSci
89
+ category: publishing
58
90
 
59
91
  ai4r:
60
- description: 'Artificial intelligence'
92
+ description: Artificial intelligence
93
+ category: machine learning
61
94
 
62
95
  bio:
63
- description: 'Bioinformatics suite'
96
+ description: Bioinformatics suite
97
+ category: biology
98
+
99
+ ruby-fftw3:
100
+ module: FFTW3
101
+ exclude: because it works only with narray
102
+ description: Fast Fourier transformation
103
+ category: numerics
104
+
105
+ ruby-band:
106
+ exclude: because of dependencies
107
+ description: Data mining
108
+ category: machine learning
109
+ module: ~
110
+
111
+ classifier:
112
+ description: Machine learning
113
+ category: machine learning
114
+
115
+ stuff-classifier:
116
+ description: Machine learning
117
+ category: machine learning
118
+ module: StuffClassifier
119
+
120
+ decisiontree:
121
+ description: Machine learning
122
+ category: machine learning
123
+ module: DecisionTree
124
+
125
+ irtruby:
126
+ exclude: because of dependencies
127
+ description: Machine learning
128
+ category: machine learning
129
+ module: IRT
130
+
131
+ ruby-opencv:
132
+ description: Computer vision
133
+ exclude: because of dependencies
134
+ category: computer vision
135
+ module: OpenCV
136
+
137
+ ruby-fann:
138
+ description: Neural networks
139
+ category: machine learning
140
+ module: RubyFann
141
+
142
+ rb-libsvm:
143
+ description: Support vector machines (machine learning)
144
+ category: machine learning
145
+ module: Libsvm
146
+
147
+ sciruby:
148
+ description: SciRuby meta gem
149
+ category: meta
150
+ exclude: to avoid circular dependencies
151
+ module: ~
152
+
153
+ sciruby-full:
154
+ description: SciRuby meta gem (Full installation)
155
+ category: meta
156
+ exclude: to avoid circular dependencies
157
+ module: ~
@@ -2,7 +2,7 @@ class Module
2
2
  alias :const_missing_without_sciruby :const_missing
3
3
 
4
4
  def const_missing(name)
5
- paths = SciRuby.gems.autoload_modules.delete(name)
5
+ paths = SciRuby.autoload_modules.delete(name)
6
6
  if paths
7
7
  paths.each {|path| require path }
8
8
  const_get(name)
data/lib/sciruby/gems.rb CHANGED
@@ -1,55 +1,54 @@
1
1
  module SciRuby
2
- # @api public
3
- class Gems
4
- # Return map of all known SciRuby gems
5
- attr_reader :all
6
-
7
- # Modules which can be autoloaded
8
- attr_reader :autoload_modules
9
-
10
- # Return map of all installed SciRuby gems
11
- def installed
12
- @installed ||=
13
- begin
14
- require 'rubygems'
15
- Hash[all.map {|name, options| installed_gem(name, options) }.compact]
16
- end
17
- end
2
+ extend self
18
3
 
19
- # Return list of all known SciRuby modules
20
- def all_modules
21
- @all_modules ||= all.map { |name, options| options[:module] }.flatten
22
- end
4
+ # Return map of all known SciRuby gems
5
+ def gems
6
+ @gems ||= {}
7
+ end
23
8
 
24
- # Return list of all installed SciRuby modules
25
- def installed_modules
26
- @installed_modules ||= installed.map { |name, options| options[:module] }.flatten
27
- end
9
+ # Modules which can be autoloaded
10
+ def autoload_modules
11
+ @autoload_modules ||= {}
12
+ end
28
13
 
29
- # Initialize gem list
30
- def initialize(file)
31
- @all, @autoload_modules = {}, {}
32
- YAML.load_file(file).each do |name, options|
33
- options = Hash[options.map {|k,v| [k.to_sym, v] }]
34
- options[:require] = [*(options[:require] || name)]
35
- options[:module] = name.capitalize unless options.include?(:module)
36
- options[:module] = [*options[:module]].map(&:to_sym)
37
- options[:module].each {|mod| @autoload_modules[mod] = options[:require] }
38
- @all[name] = options
14
+ # Return map of all installed SciRuby gems
15
+ def installed_gems
16
+ @installed_gems ||=
17
+ begin
18
+ require 'rubygems'
19
+ Hash[gems.each_value.map(&method(:installed_gem)).compact]
39
20
  end
40
- end
21
+ end
41
22
 
42
- private
23
+ # Return list of all known SciRuby modules
24
+ def modules
25
+ @modules ||= gems.each_value.map {|gem| gem[:module] }.flatten
26
+ end
43
27
 
44
- def installed_gem(name, options)
45
- [name, options.merge(gem_version: Gem::Specification.find_by_name(name).version.to_s)]
46
- rescue Exception
47
- nil
28
+ # Return list of all installed SciRuby modules
29
+ def installed_modules
30
+ @installed_modules ||= installed_gems.each_value.map {|gem| gem[:module] }.flatten
31
+ end
32
+
33
+ private
34
+
35
+ def load_gems(file)
36
+ YAML.load_file(file).each do |name, gem|
37
+ gem = Hash[gem.map {|k,v| [k.to_sym, v] }]
38
+ gem[:name] = name
39
+ gem[:require] = [*(gem[:require] || name)]
40
+ gem[:module] = name.capitalize unless gem.include?(:module)
41
+ gem[:module] = [*gem[:module]].map(&:to_sym)
42
+ gem[:module].each {|mod| autoload_modules[mod] = gem[:require] }
43
+ gems[name] = gem
48
44
  end
49
45
  end
50
46
 
51
- @gems = Gems.new(File.expand_path(File.join(__FILE__, '..', '..', '..', 'gems.yml')))
52
- class << self
53
- attr_reader :gems
47
+ def installed_gem(gem)
48
+ [gem[:name], gem.merge(gem_version: Gem::Specification.find_by_name(gem[:name]).version.to_s)]
49
+ rescue Exception
50
+ nil
54
51
  end
52
+
53
+ load_gems File.expand_path(File.join(__FILE__, '..', '..', '..', 'gems.yml'))
55
54
  end
@@ -2,5 +2,5 @@
2
2
  module SciRuby
3
3
  # SciRuby version string
4
4
  # @api public
5
- VERSION = '0.2.2'
5
+ VERSION = '0.2.3'
6
6
  end
data/sciruby.gemspec CHANGED
@@ -24,12 +24,12 @@ Gem::Specification.new do |s|
24
24
  s.files.reject! {|f| f =~ /\Alib/ }
25
25
 
26
26
  s.add_runtime_dependency 'sciruby', "= #{SciRuby::VERSION}"
27
- SciRuby.gems.all.each {|name, options| s.add_runtime_dependency name, *options[:version] }
27
+ SciRuby.gems.each_value.reject {|gem| gem[:exclude] }.each {|gem| s.add_runtime_dependency gem[:name], *gem[:version] }
28
28
  else
29
29
  s.files.delete 'sciruby-full.gemspec'
30
30
 
31
31
  m = "Please consider installing 'sciruby-full' or the following gems:\n"
32
- SciRuby.gems.all.each {|name, options| m << " * #{name}\n" }
32
+ SciRuby.gems.each_value.sort_by {|gem| gem[:name] }.each {|gem| m << " * #{gem[:name]} - #{gem[:description]}\n" }
33
33
  s.post_install_message = m << "\n"
34
34
  end
35
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sciruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SciRuby Development Team
@@ -23,6 +23,7 @@ files:
23
23
  - Gemfile
24
24
  - LICENSE.txt
25
25
  - README.rdoc
26
+ - gems.slim
26
27
  - gems.yml
27
28
  - lib/sciruby.rb
28
29
  - lib/sciruby/autoload.rb
@@ -35,26 +36,38 @@ licenses:
35
36
  metadata: {}
36
37
  post_install_message: |+
37
38
  Please consider installing 'sciruby-full' or the following gems:
38
- * nmatrix
39
- * gsl-nmatrix
40
- * rubyvis
41
- * nyaplot
42
- * plotrb
43
- * gnuplot
44
- * iruby
45
- * pry
46
- * awesome_print
47
- * daru
48
- * integration
49
- * minimization
50
- * distribution
51
- * statsample
52
- * statsample-glm
53
- * statsample-bivariate-extension
54
- * extendmatrix
55
- * publisci
56
- * ai4r
57
- * bio
39
+ * ai4r - Artificial intelligence
40
+ * awesome_print - Pretty object printing
41
+ * bio - Bioinformatics suite
42
+ * classifier - Machine learning
43
+ * daru - Dataframe library
44
+ * decisiontree - Machine learning
45
+ * distribution - Statistical distributions
46
+ * extendmatrix - Helper methods for Matrix
47
+ * gnuplot - Plotting library
48
+ * gsl-nmatrix - Bindings for the GNU scientific library
49
+ * integration - Numerical integration
50
+ * irtruby - Machine learning
51
+ * iruby - Ruby kernel for Jupyter
52
+ * minimization - Numerical minimization
53
+ * nmatrix - Numerics matrix library
54
+ * nyaplot - Plotting library
55
+ * plotrb - Plotting library
56
+ * pry - Ruby repl
57
+ * publisci - Publishing toolkit
58
+ * rb-libsvm - Support vector machines (machine learning)
59
+ * ruby-band - Data mining
60
+ * ruby-fann - Neural networks
61
+ * ruby-fftw3 - Fast Fourier transformation
62
+ * ruby-opencv - Computer vision
63
+ * rubyvis - Plotting library
64
+ * sciruby - SciRuby meta gem
65
+ * sciruby-full - SciRuby meta gem (Full installation)
66
+ * statsample - Statistics
67
+ * statsample-bivariate-extension - Statistics
68
+ * statsample-glm - Statistics
69
+ * statsample-timeseries - Statistics
70
+ * stuff-classifier - Machine learning
58
71
 
59
72
  rdoc_options: []
60
73
  require_paths: