Skip to content
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

Praat: support matrix and string vector type #1820

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

Syuparn
Copy link
Contributor

@Syuparn Syuparn commented May 6, 2022

Add types introduced in Praat version 6, matrix and string vector).

I also added some sample codes.

image

Closes #1819

Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
@tancnle tancnle added the needs-review The PR needs to be reviewed label Aug 5, 2022
@tancnle tancnle self-assigned this Aug 5, 2022
@tancnle
Copy link
Collaborator

tancnle commented Aug 7, 2022

Thank you for your contribution @Syuparn ❤️ The change looks good to me.

For posterity, are matrix and string vector support part of v5.7 (see reference)?

Comment on lines +61 to +70
functions_matrix = %w(
linear mul mul_fast mul_metal mul_nt mul_tn mul_tt outer peaks
randomGamma randomGauss randomInteger randomUniform softmaxPerRow
solve transpose zero
)

functions_string_vector = %w(
empty fileNames folderNames readLinesFromFile splitByWhitespace
)

Copy link
Collaborator

@tancnle tancnle Aug 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): For performance reasons, we generally encourage using class methods instead of instance variable. Since this has been a pattern of instance variables in this class, I think we can go ahead with this PR. I will do a follow-up MR to refactor these variables to class methods.

For references, we can check Rouge memory usages by running bundle exec rake check:memory

# rouge-memory.tmp
<snipped>
retained objects by file
-----------------------------------
     33757  rouge/lib/rouge/lexer.rb
      4971  rouge/lib/rouge/regex_lexer.rb
      1140  rouge/lib/rouge.rb
       424  rouge/lib/rouge/token.rb
       274  ruby/lib/lib/ruby/2.7.0/cgi.rb
        79  ruby/lib/lib/ruby/2.7.0/cgi/cookie.rb
        66  ruby/lib/lib/ruby/2.7.0/cgi/core.rb
        64  rouge/lib/rouge/themes/github.rb
        63  rouge/lib/rouge/theme.rb
        51  rouge/lib/rouge/themes/colorful.rb
        48  rouge/lib/rouge/lexers/go.rb
        45  rouge/lib/rouge/themes/pastie.rb
        42  rouge/lib/rouge/lexers/apple_script.rb
        40  rouge/lib/rouge/util.rb
        33  rouge/lib/rouge/guessers/disambiguation.rb
        32  rouge/lib/rouge/themes/thankful_eyes.rb
        31  rouge/lib/rouge/themes/magritte.rb
        30  rouge/lib/rouge/lexers/tcl.rb
        30  rouge/lib/rouge/themes/base16.rb
        27  rouge/lib/rouge/themes/monokai.rb
        26  rouge/lib/rouge/themes/molokai.rb
        26  rouge/lib/rouge/themes/tulip.rb
        24  rouge/lib/rouge/lexers/ruby.rb
        24  rouge/lib/rouge/themes/bw.rb
        24  rouge/lib/rouge/themes/gruvbox.rb
        18  rouge/lib/rouge/lexers/dafny.rb
        18  rouge/lib/rouge/themes/monokai_sublime.rb
        17  rouge/lib/rouge/lexers/mathematica.rb
        17  /Users/tanle/Code/personal/rouge/tasks/check/memory.rake
        15  rouge/lib/rouge/lexers/mosel.rb
        14  ruby/lib/lib/ruby/2.7.0/set.rb
        13  rouge/lib/rouge/lexers/common_lisp.rb
        13  rouge/lib/rouge/lexers/praat.rb
        ...

@tancnle tancnle merged commit 8d5a130 into rouge-ruby:master Aug 8, 2022
@tancnle tancnle removed their assignment Aug 8, 2022
@Syuparn Syuparn deleted the praat-add-types branch August 8, 2022 00:52
@Syuparn
Copy link
Contributor Author

Syuparn commented Aug 8, 2022

Thank you for your contribution @Syuparn ❤️ The change looks good to me.

For posterity, are matrix and string vector support part of v5.7 (see reference)?

@tancnle
Thank you for merging this PR!

  • Vector and Matrix was introduced in 6.0.30 (22 July 2017) (Reference)
  • String Vector was introduced in 6.1.38 (2 January 2021) (Reference)

@tancnle
Copy link
Collaborator

tancnle commented Aug 8, 2022

Thanks for clarifying @Syuparn 👍🏼. I was referencing section 5.7 in the doc, not the version number 🤦🏼‍♂️ Apology for being misleading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review The PR needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Praat: matrix types and string vector types are marked as errors
2 participants