Skip to content

Update sort #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2016
Merged

Update sort #10

merged 1 commit into from
Mar 18, 2016

Conversation

lokeshh
Copy link
Member

@lokeshh lokeshh commented Mar 10, 2016

Update notebooks due to changes in Dataframe#sort.

@lokeshh lokeshh changed the title Update sort [WIP] Update sort Mar 10, 2016
@lokeshh
Copy link
Member Author

lokeshh commented Mar 10, 2016

This is all I guess there's necessary to reflect the changes made in DataFrame#sort but I want to run all the notebooks once and verify if every thing is working fine or not. (I haven't verified yet because I am facing some issues while running other notebooks.)

Further I am also thinking about adding more examples to expose advance features of sorting in the notebook. I am not sure whether it be good idea or not because one can always look at the documentation. What do you say?

@lokeshh lokeshh changed the title [WIP] Update sort Update sort Mar 10, 2016
@v0dro
Copy link
Member

v0dro commented Mar 10, 2016

Put the advanced features in the notebook and the documentation too so that users can see everything at a glance irrespective of what material they're referring to.

@v0dro
Copy link
Member

v0dro commented Mar 10, 2016

I'm just going to try running those on my computer.

@v0dro
Copy link
Member

v0dro commented Mar 10, 2016

The notebooks run fine on my PC. I have a hunch that the problem lies in the fact that you might have installed rvm as root (given that all your paths start from /usr/local/.... Could you try with a fresh rvm install without root? Maybe there's some privilege issue?

@lokeshh lokeshh changed the title Update sort [WIP]Update sort Mar 11, 2016
@lokeshh
Copy link
Member Author

lokeshh commented Mar 11, 2016

I tried. It's the same. The error is now:

Gem::ConflictError: Unable to activate statsample-2.0.1, because spreadsheet-1.1.1 conflicts with spreadsheet (~> 1.0.3)
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:2112:in `raise_if_conflicts'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1280:in `activate'
/home/ubuntu/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems.rb:198:in `rescue in try_activate'

@lokeshh
Copy link
Member Author

lokeshh commented Mar 11, 2016

I also get following output while running iruby but it works inspite of the error or whatever it is:

> iruby
Could not load bundler: Could not locate Gemfile or .bundle/ directory
[TerminalIPythonApp] WARNING | Subcommand `ipython console` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter console`... continue in 5 sec. Press Ctrl-C to quit now.
W, [2016-03-11T13:10:15.619117 #52944]  WARN -- : Could not load bundler: Could not locate Gemfile or .bundle/ directory
/home/ubuntu/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:163:in `rescue in root'
/home/ubuntu/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:159:in `root'
/home/ubuntu/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:71:in `bundle_path'
/home/ubuntu/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:401:in `configure_gem_home_and_path'
...

EDIT: I think it's normal. It was reported by other people as fine ans just a warning.

@lokeshh
Copy link
Member Author

lokeshh commented Mar 11, 2016

I think the issue with gnuplotrb is resolved. Though I am getting another error message but I don't think this has to do with gnuplotrb.

NoMethodError: undefined method `keys' for nil:NilClass

@lokeshh
Copy link
Member Author

lokeshh commented Mar 11, 2016

I think the issue is resolved now. Earlier 'statsample' was working with irb but not with iruby. Now it's not working with both. The only thing left to do is to now resolve statsample conflict and we are good to go.

@v0dro
Copy link
Member

v0dro commented Mar 12, 2016

I think you should activate the gems with the gem method first.

gem 'statsample'

@v0dro
Copy link
Member

v0dro commented Mar 12, 2016

That statsample error is being caused because the latest daru uses spreadsheet 1.1.1 and statsample uses an older version. I have pushed changes to the master of Sciruby/statsample, but the maintainers are yet to release a new version of the gem. Until then, you can use statsample from github directly.

@lokeshh
Copy link
Member Author

lokeshh commented Mar 15, 2016

Thanks. Statsample issue if fixed now. Just a couple of things are left to take care of then we are done:

  • A weird output displays on the first cell and plots do not work no matter what because the code which is being displayed is supposed to be executed not displayed.

(Click here to see the image)

  • Getting NoMethodError: undefined methodkeys' for nil:NilClass`with gnuplotrb

I think first issue is because my installation is not compatible with iruby. I am using Ubuntu and followed the procedure given here.

@v0dro
Copy link
Member

v0dro commented Mar 15, 2016

That output is from nyaplot. It can be silenced by putting a lone print statement after the require 'daru'.

@lokeshh
Copy link
Member Author

lokeshh commented Mar 15, 2016

I have got a feeling that this output shouldn't be displayed. Because it doesn't display in nbviewer and plotting works fine there. The plots are not running on my system. I ran all the cells and then ran that modified notebook in nbviewer and plotting functionality also stopped there. My running all the cells is disrupting the plotting functionality. So, maybe something is wrong with new daru or nyaplot or ipython notebook or something else I don't know yet.

EDIT: I do not get the weird output after running the first cell but only every time I load the notebook with/without loading the kernel. That means running the first cell simply makes the output disappear and when I reload the notebook it's there.

@lokeshh lokeshh changed the title [WIP]Update sort Update sort Mar 17, 2016
Save data files in a seperate folder "Data" so user do not have to
download all the data files required in the notebook
@lokeshh
Copy link
Member Author

lokeshh commented Mar 17, 2016

I've added additional examples and modified sort wherever necessary. The other task which was to run all the notebooks and verify they are running properly may take some more time and I think it's better to do it in another PR.

In this PR, I have done the following:

  • Add additional examples to express advance functions of DataFrame#sort
  • Modified sort use wherever necessary. (It was only required with one notebook and luckily it didn't has any plots. So, it's safe to merge this PR without losing plots.)
  • Saved required CSV's files in a folder Data to save the user from downloading the files separately in order to run the notebook.

I haven't touched any other notebook other than Usage of DataFrame because it would probably distort the plotting functionality. I am looking forward to update the output of all the other remaining notebooks and verify they are running properly which involve plots in another PR but it requires the plotting functionality to be fixed beforehand or fix my installation if that's the problem.

@v0dro
Copy link
Member

v0dro commented Mar 18, 2016

Can you try using Chrome?

Also, is this ready for merge?

@lokeshh
Copy link
Member Author

lokeshh commented Mar 18, 2016 via email

@v0dro
Copy link
Member

v0dro commented Mar 18, 2016

Yeah it does! Alternatively you can try using gnuplotrb for future plotting. It's pretty easy to use and has more features in many respects.

v0dro added a commit that referenced this pull request Mar 18, 2016
@v0dro v0dro merged commit 58b8d4b into SciRuby:master Mar 18, 2016
@lokeshh
Copy link
Member Author

lokeshh commented Mar 21, 2016

Do both gnuplotrb and nyaplot only work in iRuby or would they also show the plot in IRB?

@v0dro
Copy link
Member

v0dro commented Mar 21, 2016

I think only in iRuby. You'll need to export to an SVG file and open it separately in order to view them from irb.

@lokeshh
Copy link
Member Author

lokeshh commented Mar 21, 2016

nyaplot had the functionality to write to html in irb. I did that and when I opened the html file to which it exported the plot, I got a blank html with title as "Nyaplot". This confirms the problem's not with iRuby. Did you ran the notebooks with the latest gems releases?

@lokeshh
Copy link
Member Author

lokeshh commented Mar 21, 2016

Gnuplotrb is working fine for me except for this.

@v0dro
Copy link
Member

v0dro commented Mar 22, 2016

I've never tried working with nyaplot on irb. If that is the case it should be a nyaplot issue.

@lokeshh
Copy link
Member Author

lokeshh commented Mar 24, 2016

Hurray! This patch domitry/nyaplot#67 fixes everything. Now plotting is working fine for me. I will update all the notebooks now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants