galaaz 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -5
- data/README.md +119 -94
- data/Rakefile +17 -10
- data/bin/galaaz-jruby +3 -6
- data/bin/galaaz-ruby +16 -0
- data/bin/galaaz_ruby_env.inc.sh +36 -0
- data/bin/gbookdown +2 -3
- data/bin/gknit +2 -3
- data/bin/gstudio +4 -4
- data/bin/run_all_rspec +6 -5
- data/bin/run_example +10 -7
- data/bin/run_old_rspec +6 -5
- data/bin/run_rspec +9 -8
- data/bin/run_slow_rspec +6 -5
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-gfm/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-gfm/scatter_plot_rb.png +0 -0
- data/blogs/gknit/gknit_files/figure-gfm/bubble-1.png +0 -0
- data/blogs/gknit/gknit_files/figure-gfm/diverging_bar.png +0 -0
- data/blogs/manual/manual.Rmd +22 -19
- data/blogs/manual/manual.md +119 -94
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-gfm/violin_with_jitter.png +0 -0
- data/blogs/test/test.md +10 -0
- data/examples/50Plots_MasterList/ScatterPlot.rb +2 -1
- data/examples/50Plots_MasterList/scatter_plot.rb +1 -0
- data/examples/bioconductor_deseq2_airway/bench_galaaz_three_same_process.rb +1 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz.rb +1 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz_optimized.rb +1 -0
- data/examples/islr/all.rb +1 -0
- data/examples/islr/ch2.spec.rb +1 -0
- data/examples/islr/ch3.spec.rb +1 -0
- data/examples/islr/ch3_boston.rb +1 -0
- data/examples/islr/ch3_multiple_regression.rb +1 -0
- data/examples/islr/ch6.spec.rb +1 -0
- data/examples/islr/x_y_rnorm.jpg +0 -0
- data/examples/misc/ggplot.rb +2 -1
- data/examples/misc/moneyball.rb +1 -0
- data/examples/misc/subsetting.rb +1 -0
- data/examples/multithread_shards_to_r/shards_to_r.rb +1 -0
- data/examples/sthda_ggplot/all.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/density_gg.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_area.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_density.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_dotplot.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_freqpoly.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_histogram.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/histogram_density.rb +1 -0
- data/examples/sthda_ggplot/one_variable_continuous/stat.rb +1 -0
- data/examples/sthda_ggplot/one_variable_discrete/bar.rb +1 -0
- data/examples/sthda_ggplot/qplots/box_violin_dot.rb +1 -0
- data/examples/sthda_ggplot/qplots/scatter_plots.rb +1 -0
- data/examples/sthda_ggplot/scatter_gg.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_bin2d.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_density2d.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_hex.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_point.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_smooth.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/misc.rb +1 -0
- data/examples/sthda_ggplot/two_variables_cont_function/geom_area.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_bar.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_boxplot.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_dotplot.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_jitter.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_line.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_violin.rb +1 -0
- data/examples/sthda_ggplot/two_variables_disc_disc/geom_jitter.rb +1 -0
- data/examples/sthda_ggplot/two_variables_error/geom_crossbar.rb +1 -0
- data/lib/R_interface/rvector.rb +15 -0
- data/lib/galaaz_ruby.rb +34 -0
- data/lib/new_bridge/envelope.rb +2 -2
- data/specs/gknit_include_engine_spec.rb +2 -2
- data/specs/gknit_install_timeout_report_spec.rb +2 -2
- data/specs/gknit_internal_error_report_spec.rb +2 -2
- data/specs/gknit_vector_map_output_spec.rb +2 -2
- data/version.rb +1 -1
- metadata +39 -13
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/blogs/test/test.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Minimal gknit callback test
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
``` ruby
|
|
5
|
+
# Minimal ruby chunk: triggers process_options and options['fig.ext'].unboxed_get(0).
|
|
6
|
+
# Same R code path as oh_my.Rmd first ruby chunk (sends .GlobalEnv$g2_vN <- g2_vM[[1]] for fig.ext).
|
|
7
|
+
puts "ok"
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## ok
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
##########################################################################################
|
|
23
23
|
|
|
24
24
|
require 'galaaz'
|
|
25
|
+
using Galaaz::SymbolDSL
|
|
25
26
|
require 'ggplot'
|
|
26
27
|
|
|
27
28
|
module CorpTheme
|
|
@@ -156,4 +157,4 @@ sp.add_smoothing_line(method: "glm")
|
|
|
156
157
|
sp.plot
|
|
157
158
|
|
|
158
159
|
|
|
159
|
-
a = gets.chomp
|
|
160
|
+
a = gets.chomp if $stdin.tty?
|
data/examples/islr/all.rb
CHANGED
data/examples/islr/ch2.spec.rb
CHANGED
data/examples/islr/ch3.spec.rb
CHANGED
data/examples/islr/ch3_boston.rb
CHANGED
data/examples/islr/ch6.spec.rb
CHANGED
data/examples/islr/x_y_rnorm.jpg
CHANGED
|
Binary file
|
data/examples/misc/ggplot.rb
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
##########################################################################################
|
|
23
23
|
|
|
24
24
|
require 'galaaz'
|
|
25
|
+
using Galaaz::SymbolDSL
|
|
25
26
|
require 'ggplot'
|
|
26
27
|
|
|
27
28
|
module LightBlueTheme
|
|
@@ -154,7 +155,7 @@ R.grid__newpage
|
|
|
154
155
|
R.geom_point('')).print
|
|
155
156
|
=end
|
|
156
157
|
|
|
157
|
-
a = gets.chomp
|
|
158
|
+
a = gets.chomp if $stdin.tty?
|
|
158
159
|
|
|
159
160
|
|
|
160
161
|
=begin
|
data/examples/misc/moneyball.rb
CHANGED
data/examples/misc/subsetting.rb
CHANGED
data/lib/R_interface/rvector.rb
CHANGED
|
@@ -177,6 +177,21 @@ module R
|
|
|
177
177
|
end
|
|
178
178
|
end
|
|
179
179
|
|
|
180
|
+
# CRuby Enumerable#sum probes begin/end (range fast-path). R::Object#respond_to?
|
|
181
|
+
# always returns true, so that probe would hit method_missing and call R's begin.
|
|
182
|
+
# Implement sum in Ruby so MRI matches JRuby Enumerable behavior for blocks;
|
|
183
|
+
# without a block, forward to R's sum via method_missing.
|
|
184
|
+
def sum(*args, &block)
|
|
185
|
+
if block
|
|
186
|
+
::Kernel.raise(::ArgumentError, "wrong number of arguments (given #{args.size}, expected 0..1)") if args.size > 1
|
|
187
|
+
acc = args.empty? ? 0 : args[0]
|
|
188
|
+
each { |el| acc = acc + block.call(el) }
|
|
189
|
+
acc
|
|
190
|
+
else
|
|
191
|
+
method_missing(:sum, *args)
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
180
195
|
#--------------------------------------------------------------------------------------
|
|
181
196
|
# Need to override each_with_index, as R indexing starts at 1
|
|
182
197
|
#--------------------------------------------------------------------------------------
|
data/lib/galaaz_ruby.rb
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'shellwords'
|
|
4
|
+
|
|
5
|
+
# Interpreter selection for Ruby launchers (bin/gknit, bin/gbookdown, bin/gstudio, Rake).
|
|
6
|
+
# Default is `ruby` on PATH (JRuby or CRuby). Override with GALAAZ_RUBY=jruby / ruby / path.
|
|
7
|
+
# JVM flags are applied only when the selected interpreter is JRuby (see galaaz_jruby.rb).
|
|
8
|
+
module GalaazRuby
|
|
9
|
+
def self.interpreter
|
|
10
|
+
bin = ENV['GALAAZ_RUBY'].to_s.strip
|
|
11
|
+
bin.empty? ? 'ruby' : bin
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.jruby?(bin = interpreter)
|
|
15
|
+
base = File.basename(bin.to_s)
|
|
16
|
+
return true if base == 'jruby' || base.start_with?('jruby.')
|
|
17
|
+
|
|
18
|
+
engine = `#{Shellwords.escape(bin)} -e 'print RUBY_ENGINE' 2>/dev/null`.to_s.strip
|
|
19
|
+
engine == 'jruby'
|
|
20
|
+
rescue StandardError
|
|
21
|
+
false
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Shell prefix: "<bin> [jvm-args] -I<lib_path>"
|
|
25
|
+
def self.shell_invocation(lib_path)
|
|
26
|
+
bin = interpreter
|
|
27
|
+
if jruby?(bin)
|
|
28
|
+
require_relative 'galaaz_jruby'
|
|
29
|
+
"#{bin} #{GalaazJRuby.shell_j_arg_string} -I#{lib_path}"
|
|
30
|
+
else
|
|
31
|
+
"#{bin} -I#{lib_path}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/lib/new_bridge/envelope.rb
CHANGED
|
@@ -22,7 +22,7 @@ module NewBridge
|
|
|
22
22
|
raise InvalidEnvelope, "unknown keys: #{extra.join(', ')}" unless extra.empty?
|
|
23
23
|
|
|
24
24
|
MessagePack.pack(h)
|
|
25
|
-
rescue MessagePack::MalformedFormatError, MessagePack::UnpackError => e
|
|
25
|
+
rescue MessagePack::MalformedFormatError, MessagePack::UnpackError, EOFError => e
|
|
26
26
|
raise Error, "MsgPack pack failed: #{e.message}"
|
|
27
27
|
end
|
|
28
28
|
|
|
@@ -39,7 +39,7 @@ module NewBridge
|
|
|
39
39
|
raise InvalidEnvelope, "missing keys: #{missing.join(', ')}" unless missing.empty?
|
|
40
40
|
|
|
41
41
|
h
|
|
42
|
-
rescue MessagePack::MalformedFormatError, MessagePack::UnpackError => e
|
|
42
|
+
rescue MessagePack::MalformedFormatError, MessagePack::UnpackError, EOFError => e
|
|
43
43
|
raise Error, "invalid MsgPack envelope: #{e.message}"
|
|
44
44
|
end
|
|
45
45
|
|
|
@@ -13,10 +13,10 @@ describe 'gknit include engine' do
|
|
|
13
13
|
].select { |dir| File.directory?(dir) }
|
|
14
14
|
path = ENV.fetch('PATH', '')
|
|
15
15
|
path = ([*extra, path].join(File::PATH_SEPARATOR)) unless extra.empty?
|
|
16
|
-
|
|
16
|
+
ENV.to_h.merge(
|
|
17
17
|
'JAVA_OPTS' => '--add-opens=java.base/java.nio=ALL-UNNAMED',
|
|
18
18
|
'PATH' => path
|
|
19
|
-
|
|
19
|
+
)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it 'loads include file code so constants are available in following ruby chunks' do
|
|
@@ -13,10 +13,10 @@ describe 'gknit install timeout reporting' do
|
|
|
13
13
|
].select { |dir| File.directory?(dir) }
|
|
14
14
|
path = ENV.fetch('PATH', '')
|
|
15
15
|
path = ([*extra, path].join(File::PATH_SEPARATOR)) unless extra.empty?
|
|
16
|
-
|
|
16
|
+
ENV.to_h.merge(
|
|
17
17
|
'JAVA_OPTS' => '--add-opens=java.base/java.nio=ALL-UNNAMED',
|
|
18
18
|
'PATH' => path
|
|
19
|
-
|
|
19
|
+
)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it 'continues processing and prints timeout in final report' do
|
|
@@ -13,10 +13,10 @@ describe 'gknit internal error report' do
|
|
|
13
13
|
].select { |dir| File.directory?(dir) }
|
|
14
14
|
path = ENV.fetch('PATH', '')
|
|
15
15
|
path = ([*extra, path].join(File::PATH_SEPARATOR)) unless extra.empty?
|
|
16
|
-
|
|
16
|
+
ENV.to_h.merge(
|
|
17
17
|
'JAVA_OPTS' => '--add-opens=java.base/java.nio=ALL-UNNAMED',
|
|
18
18
|
'PATH' => path
|
|
19
|
-
|
|
19
|
+
)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it 'prints chunk-scoped report only when internal errors are detected' do
|
|
@@ -13,10 +13,10 @@ describe 'gknit vector map output' do
|
|
|
13
13
|
].select { |dir| File.directory?(dir) }
|
|
14
14
|
path = ENV.fetch('PATH', '')
|
|
15
15
|
path = ([*extra, path].join(File::PATH_SEPARATOR)) unless extra.empty?
|
|
16
|
-
|
|
16
|
+
ENV.to_h.merge(
|
|
17
17
|
'JAVA_OPTS' => '--add-opens=java.base/java.nio=ALL-UNNAMED',
|
|
18
18
|
'PATH' => path
|
|
19
|
-
|
|
19
|
+
)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
it 'renders vec.map in ruby chunks without missing bridge methods' do
|
data/version.rb
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$gem_name = "galaaz"
|
|
2
|
-
$version="2.
|
|
2
|
+
$version="2.1.0"
|