GSoC 2019 Project [ Rubyplot ] discussion

[RUBYPLOT-GSOC][DAILY][9 July] Show

Planned progress
Implement show function for GR

Progress

  • Implemented a basic show function for GR backend

Problems

  • If after calling show on a figure, a plot is added to a subplot and then write is called then the figure is not as expected. This happens for both the backends(similar incorrect figure is drawn)
  • the device argument is always kept as a file, which indicates saving the figure. Another option is window which is for displaying the figure. This argument can be removed, I will look into this soon.

Plans

  • solve the bug for consecutive show and write calling
  • complete the blogs
  • Create a list of plots
  • implement ticks

I have booked my visa appointment and I need to travel to Bombay for it and hence I will not be able to work on 11th, 12th and 13th. I will cover for this by working extra after returning.

Did you try using a variable to indicate change of state as we had discussed over the call?

Yes, I did try it but it had some issues related to calling the init_output_device and stop_output_device functions. I will explain the issues in more detail in today’s call.

I couldn’t work on 10th and 11th July due to my visa application and appointment.

[RUBYPLOT-GSOC][DAILY][12 July] Show

Planned progress
Documentation for show function

Progress

  • Had the weekly meeting with @v0dro
  • Improved the show function
  • Tested with different combinations of the show and write and changing the plots in between

Problems

  • Suppose I call the write/show function and then add a plot in a subplot without initializing, it doesn’t work. But if it is initialized again, it works. So, it is necessary to initialize again after calling the write/show function.
    The same thing happens with matplotlib, initialization is necessary. @v0dro
  • GR backend does not wait at the show function, suppose I call it two times, it shows the first time for a very short amount of time and then the second one for longer, is there any way to stop it at a show function and allow the user to keep it displaying for however long the user wants and then when a command is given then the code is executed further, @v0dro could you help me with this?

Meeting summary
Summary and To-do list:

  • Discussed optimizing the show function without having to save the is_initialized state variable
  • Discussed the device argument

Plans

  • complete the blogs
  • Create a list of plots
  • implement ticks

[RUBYPLOT-GSOC][DAILY][13 July] Plot

Planned progress
Working on the plot function

Progress

  • Looked into the plot function frontend
  • Corrected the tests for plot function, changed the unit of the input of sin and cosine from radians to degrees

Problems

  • The backend of the plot function uses Line2D(draw_lines) and draw_markers which are already implemented for Magick except for the line types and some marker types.
  • The plot function currently either plots lines or markers, but ideally, it should do both (if specified)
  • For the format of fmt argument, the string format should be decided, options are keeping it short like matplotlib or having full strings
  • There should be different options for marker_fill_color and marker_border_color and line colour
  • Magick backend can not plot a figure having size 400 cms

Plans

  • Complete the blogs
  • Create a list of plots
  • Implement remaining marker and line types
  • Work on Plot
  • Implement ticks

Yes. Use initialization for now.

Hmmm I’m not too familiar with this part of the GR backend. However I do remember that Pranav had tried to do something similar with GR. Here’s the script that he made: https://github.com/pgtgrly/GRruby-extension/blob/master/examples/GRFramework/Example.rb#L54

I haven’t used this script in a long time but as far as I remember, it does work.

Yes. This should depend on the format string provided by the user.

I’d prefer both. Ruby symbols with full names or strings with shortcuts like in Python.

Just throw an error.

Also, finish the blogs faster.

sure

gets doesn’t work, it waits for some time (I think this is GR default) and then gives this error:
Failures:

  1. Rubyplot::Axes b: #Rubyplot::Backend::GRWrapper:0x00005572753e6150. #plot! plots a simple plot with plus marker of green color
    Failure/Error: hold = gets

    Errno::ENOENT:
    No such file or directory @ rb_sysopen - --t=focus
    /# ./lib/rubyplot/backend/gr_wrapper.rb:350:in ā€˜gets’
    /# ./lib/rubyplot/backend/gr_wrapper.rb:350:in ā€˜gets’
    /# ./lib/rubyplot/backend/gr_wrapper.rb:350:in ā€˜stop_output_device’
    /# ./lib/rubyplot/artist/figure.rb:116:in ā€˜show’
    /# ./spec/axes_spec.rb:118:in ā€˜block (3 levels) in <top (required)>’

I will make the necessary changes.

I’ll figure a way for this

okay

Yes, they’ll be done by Wednesday EOD

[RUBYPLOT-GSOC][DAILY][15 July] Plot

Planned progress
Working on Plot function

Progress

  • Worked on format of fmt argument
  • Added error handling of large figures for magick backend

Problems

Plans

  • Complete blogs(Will be done by Wednesday)
  • work on plot function
  • Implement remaining marker and line types
  • Create a list of plots
  • Implement ticks

I was not able to work yesterday (16 July) as I had to make arrangements for my visa appointment (I have been called again for it). I will be having my visa appointment tomorrow(18 July) and hence won’t be able to work today and tomorrow due to traveling. However, I will try to complete the blogs during my travel.
Sorry for the inconvenience @v0dro

Marker type symbols:

dot .
plus +
asterisk *
circle O
diagonal_cross x
solid_circle sO
triangle_up ^
solid_triangle_up s^
triangle_down v
solid_triangle_down sv
square q
solid_square sq
bowtie b
solid_bowtie sb
hglass h
solid_hglass sh
diamond d
solid_diamond sd
star s
solid_star ss
tri_up_down ^v
solid_tri_right s>
solid_tri_left s<
hollow_plus h+
solid_plus s+
pentagon p
hexagon hx
heptagon hp
octagon oc
star_4 s4
star_5 s5
star_6 s6
star_7 s7
star_8 s8
vline |
hline _
omark o

Line type symbols:
solid -
dashed –
dotted -.
dashed_dotted --.
dash_2_dot -…
dash_3_dot -…
long_dash —
long_short_dash –
spaced_dash -
-
spaced_dot ._.
double_dot …
triple_dot …

[RUBYPLOT-GSOC][DAILY][19 July] Plot

Planned progress
Working on Plot function

Progress

  • Finished implementing the frontend for the plot function
  • Had a weekly meeting with @v0dro

Problems

Meeting summary
To-do list before 2nd evaluation starts:

  • Implement the plot function frontend (done)
  • Create a list of plots
  • Complete the blogs
  • Implement the remaining marker and line types, as many as possible

Plans

  • Complete the blogs
  • Create a list of plots
  • Implement remaining marker and line types

@v0dro Some of the marker types of matplotlib differ from Rubyplot and hence these are the characters assigned for each marker type, colour and line type:

COLOR_TYPES_FMT = {
          'b' => :blue,
          'g' => :green,
          'r' => :red,
          'c' => :cyan,
          'm' => :magenta,
          'y' => :yellow,
          'k' => :black,
          'w' => :white
    }.freeze

    MARKER_TYPES_FMT = {
      '.' => :dot,
      ',' => :omark,
      'o' => :circle,
      'v' => :traingle_down,
      '^' => :traingle_up,
      '<' => :solid_tri_left,
      '>' => :solid_tri_right,
      '1' => :solid_triangle_down,
      '2' => :solid_triangle_up,
      '3' => :solid_tri_left,
      '4' => :solid_tri_right,
      's' => :square,
      'p' => :pentagon,
      '*' => :star,
      'h' => :hexagon,
      'H' => :heptagon,
      '+' => :plus,
      'x' => :diagonal_cross,
      'D' => :solid_diamond,
      'd' => :diamond,
      '|' => :vline,
      '_' => :hline
    }

    LINE_TYPES_FMT ={
      '--' => :dashed,
      '-.' => :dashed_dotted,
      '-' => :solid,
      ':' => :dotted
    }

[RUBYPLOT-GSOC][DAILY][20 July] Plot

Planned progress
Working on Plot function

Progress

  • worked on blogs

Problems

Plans

  • Complete the blogs
  • Create a list of plots
  • Implement remaining marker and line types

[RUBYPLOT-GSOC][DAILY][22 - 26 July] 2nd phase Evaluation

Worked on Code review and the blogs

[RUBYPLOT-GSOC][DAILY][27 July] Plot

Planned progress
Writing plot function tests

Progress

Problems

Plans

  • Write tests for fmt argument of the plot function
  • Complete the multi plots blog
  • Look into iruby notebooks

[RUBYPLOT-GSOC][DAILY][29 July] iruby

Planned progress

Progress
Looked into iruby notebboks codebase

Problems

Plans

  • Integrate Rubyplot with iruby notebooks
  • Complete the remaining blog
  • Make a list of polts

I will be unavailable to work from 30th July to 3-4 August due to packing, traveling and shifting to France for my bachelor’s thesis.
I had already included this in my timeline and hence my project won’t be affected.
Sorry for the inconvenience and I will cover up by working extra in the coming weeks.
@v0dro

[RUBYPLOT-GSOC][DAILY][5 August] iruby

Planned Progress
Integrating iruby with Rubyplot

Progress
Tried to set up Rubyplot on my laptop but rmagick installation is giving some errors

Problems
I will find a solution for the errors and will continue the work

Plan

  • Set up Rubyplot
  • Work as planned