Skip to content

Commit 66536be

Browse files
committed
update to_html and wrote contributing guide
1 parent 84074c8 commit 66536be

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
daru-0.0.5.gem
1+
*.gem
22
Gemfile.lock

CONTRIBUTING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing guide
2+
3+
## Installing daru development dependencies
4+
5+
If you want to run the full rspec suite, you will need the latest unreleased nmatrix and gsl-nmatrix ruby gems. They will released upstream soon but please follow this procedure for now.
6+
7+
Keep in mind that either nmatrix OR gsl-nmatrix are NOT NECESSARY for using daru. They are just required for an optional speed up.
8+
9+
To install dependencies, execute the following commands:
10+
11+
`export CPLUS_INCLUDE_PATH=/usr/include/atlas`
12+
`export C_INCLUDE_PATH=/usr/include/atlas`
13+
`sudo apt-get update -qq`
14+
`sudo apt-get install -qq libatlas-base-dev`
15+
`sudo apt-get --purge remove liblapack-dev liblapack3 liblapack3gf`
16+
`sudo apt-get install -y libgsl0-dev r-base r-base-dev`
17+
`sudo Rscript -e "install.packages(c('Rserve','irr'),,'http://cran.us.r-project.org')"`
18+
19+
Then execute the .build.sh script to clone and install the latest nmatrix and gsl-nmatrix on your system:
20+
21+
`./.build.sh`
22+
23+
Then finally install remaining dependencies:
24+
25+
`bundle install`
26+
27+
And run the test suite (should be all green with pending tests):
28+
29+
`bundle exec rspec`
30+
31+
If you have problems installing nmatrix, please consult the [nmatrix installation wiki](https://github.com/SciRuby/nmatrix/wiki/Installation) or the [mailing list](https://groups.google.com/forum/#!forum/sciruby-dev).

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
source 'https://rubygems.org'
22
gemspec
3-
4-
# gem 'gsl-nmatrix', :git => "https://github.com/v0dro/gsl-nmatrix.git", :ref => "763413625c39231e916cc6f38dfa0141598a9b80"
5-
gem 'gsl-nmatrix'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Written in pure Ruby so should work with all ruby implementations. Tested with M
2727
* Optional speed and space optimization on MRI with [NMatrix](https://github.com/SciRuby/nmatrix) and GSL.
2828
* Easy splitting, aggregation and grouping of data.
2929
* Quickly reducing data with pivot tables for quick data summary.
30+
* Import and exports dataset from and to Excel, CSV, Databases and plain text files.
3031

3132
## Notebooks
3233

lib/daru/dataframe.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,9 +1684,10 @@ def to_html threshold=30
16841684
(@vectors + 1).size.times { html += '<td>...</td>' }
16851685
html += '</tr>'
16861686

1687-
last_row = self.row[size - 1]
1687+
last_index = @index.to_a.last
1688+
last_row = self.row[last_index]
16881689
html += '<tr>'
1689-
html += "<td>" + @index[size-1].to_s + "</td>"
1690+
html += "<td>" + last_index.to_s + "</td>"
16901691
(0..(ncols - 1)).to_a.each do |i|
16911692
html += '<td>' + last_row[i].to_s + '</td>'
16921693
end

0 commit comments

Comments
 (0)