<commit_before>
require_relative 'scale'

module Io::Creat::Slipstick

  # trigonometric scales are aligned to single sized decimal scales (1-10)
  class TrigonometricScale < Scale
    MAX_LOOPS = 10

    public
    def set_params ( upper_deg, lower_deg, steps_deg, clear_mm = 5 )
      # ranges and stepping specified in degrees
      @upper_deg   = upper_deg
      @lower_deg   = lower_deg
      @steps_deg   = steps_deg
      @clear_mm    = clear_mm
      @scale       = @w_mainscale_mm / 1
      @initialized = true
      @precision   = 10
                 # dist    total ticks        grouping
      @fodders = { 1  => [ [ 12.0, 6.0 ],     [ 2, 6 ] ],
                   5  => [ [ 30.0, 15.0, 5 ], [ 5, 10, 1 ] ],
                   10 => [ [ 20.0 ],          [ 2, 10 ] ],
                   20 => [ [ 10.0 ],          [ 2, 10 ] ] }
    end

    # x position calculation function, must be overriden in the subclasses<commit_msg>Fix retries limit in trigonometric scales calculation.<commit_after>
require_relative 'scale'

module Io::Creat::Slipstick

  # trigonometric scales are aligned to single sized decimal scales (1-10)
  class TrigonometricScale < Scale
    MAX_LOOPS = 100

    public
    def set_params ( upper_deg, lower_deg, steps_deg, clear_mm = 5 )
      # ranges and stepping specified in degrees
      @upper_deg   = upper_deg
      @lower_deg   = lower_deg
      @steps_deg   = steps_deg
      @clear_mm    = clear_mm
      @scale       = @w_mainscale_mm / 1
      @initialized = true
      @precision   = 10
                 # dist    total ticks        grouping
      @fodders = { 1  => [ [ 12.0, 6.0 ],     [ 2, 6 ] ],
                   5  => [ [ 30.0, 15.0, 5 ], [ 5, 10, 1 ] ],
                   10 => [ [ 20.0 ],          [ 2, 10 ] ],
                   20 => [ [ 10.0 ],          [ 2, 10 ] ] }
    end

    # x position calculation function, must be overriden in the subclasses
{'fraction_non_alphanumeric': 0.10324947589098532, 'fraction_numerical': 0.04769392033542977, 'mean_word_length': 1.7193732193732194, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '452055', 'n_tokens_mistral': 682, 'n_tokens_neox': 587, 'n_words': 175}