Skip to content

Commit

Permalink
update to_html and wrote contributing guide
Browse files Browse the repository at this point in the history
  • Loading branch information
v0dro committed Jun 12, 2015
1 parent 84074c8 commit 66536be
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
daru-0.0.5.gem
*.gem
Gemfile.lock
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing guide

## Installing daru development dependencies

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.

Keep in mind that either nmatrix OR gsl-nmatrix are NOT NECESSARY for using daru. They are just required for an optional speed up.

To install dependencies, execute the following commands:

`export CPLUS_INCLUDE_PATH=/usr/include/atlas`
`export C_INCLUDE_PATH=/usr/include/atlas`
`sudo apt-get update -qq`
`sudo apt-get install -qq libatlas-base-dev`
`sudo apt-get --purge remove liblapack-dev liblapack3 liblapack3gf`

This comment has been minimized.

Copy link
@abinashmeher999

abinashmeher999 Jun 18, 2015

I executed this and this also asks for removal of extra packages that I don't want to remove.

The following packages will be REMOVED:
  libgazebo4-dev* liblapack-dev* liblapack3* liblapack3gf* liboctave-dev*
  libsimbody-dev* ros-indigo-gazebo4-plugins* ros-indigo-gazebo4-ros*
  ros-indigo-gazebo4-ros-control* ros-indigo-gazebo4-ros-pkgs*

This comment has been minimized.

Copy link
@abinashmeher999

abinashmeher999 Jun 18, 2015

@v0dro mentioning you so that you get notified.

This comment has been minimized.

Copy link
@v0dro

v0dro Jun 18, 2015

Author Member

Unfortunately that's essential for NMatrix to work as of now. Its removing octave because LAPACK is a dependency in octave.

@wlevine is working to stop this, but until then this will need to be done.

Of course you dont need NMatrix to use daru so I think that's fine for now.

This comment has been minimized.

Copy link
@abinashmeher999

abinashmeher999 Jun 18, 2015

I see. I will try it out and let you know.

This comment has been minimized.

Copy link
@wlevine

wlevine Jun 18, 2015

Contributor

I don't really understand why this is happening. liboctave-dev doesn't explicitly require the liblapack* packages, and all the dependencies should be met by the atlas packages. Regardless, you don't need to uninstall anything to use nmatrix, you can just use update-alternatives command to force the use of the ATLAS version of liblapack.so.

This comment has been minimized.

Copy link
@v0dro

v0dro Jun 18, 2015

Author Member

^ That makes sense. Though its not required in the build script because it's mainly written for Travis builds and works fine over there for now.

This comment has been minimized.

Copy link
@abinashmeher999

abinashmeher999 Jun 19, 2015

Thanks @wlevine. On autocompletion after typing update-alternatives --config, I get two options. liblapack.so and liblapack.so.3. I should choose liblapack.so, right? but that's not the one in the link.

This comment has been minimized.

Copy link
@wlevine

wlevine Jun 19, 2015

Contributor

I think liblapack.so.3 is the one you need to change, but I would change both just to be safe.

`sudo apt-get install -y libgsl0-dev r-base r-base-dev`
`sudo Rscript -e "install.packages(c('Rserve','irr'),,'http://cran.us.r-project.org')"`

Then execute the .build.sh script to clone and install the latest nmatrix and gsl-nmatrix on your system:

`./.build.sh`

Then finally install remaining dependencies:

`bundle install`

And run the test suite (should be all green with pending tests):

`bundle exec rspec`

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).
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
source 'https://rubygems.org'
gemspec

# gem 'gsl-nmatrix', :git => "https://github.com/v0dro/gsl-nmatrix.git", :ref => "763413625c39231e916cc6f38dfa0141598a9b80"
gem 'gsl-nmatrix'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Written in pure Ruby so should work with all ruby implementations. Tested with M
* Optional speed and space optimization on MRI with [NMatrix](https://github.com/SciRuby/nmatrix) and GSL.
* Easy splitting, aggregation and grouping of data.
* Quickly reducing data with pivot tables for quick data summary.
* Import and exports dataset from and to Excel, CSV, Databases and plain text files.

## Notebooks

Expand Down
5 changes: 3 additions & 2 deletions lib/daru/dataframe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1684,9 +1684,10 @@ def to_html threshold=30
(@vectors + 1).size.times { html += '<td>...</td>' }
html += '</tr>'

last_row = self.row[size - 1]
last_index = @index.to_a.last
last_row = self.row[last_index]
html += '<tr>'
html += "<td>" + @index[size-1].to_s + "</td>"
html += "<td>" + last_index.to_s + "</td>"
(0..(ncols - 1)).to_a.each do |i|
html += '<td>' + last_row[i].to_s + '</td>'
end
Expand Down

0 comments on commit 66536be

Please sign in to comment.