SciRuby / numruby

Fast Numerical Linear Algebra Library for Ruby. NMatrix reimplementation.
BSD 3-Clause "New" or "Revised" License
45 stars 10 forks source link

add serialization #56

Open pkspyder007 opened 3 years ago

pkspyder007 commented 3 years ago

Description

Added serialization for NMatrix class using Marshal module and custom implementation of load and dump functions. Default Marshal serialization methods threw error so We needed to create our own serialization/deserialization strategies. nm_int is the default fallback for dtype if it's not nm_float64 or nm_bool

Closes #35

(Explain how this PR changes numruby.) This PR adds the ability for NMatrix to serialize the class objects which can be used to store the data in a file for future and to pass it between different processes and to be utilized

Test Plan

the test is written for comparing the original object and the one after serialization and deserialization it checks for nm_float64, nm_int, and nm_bool dtypes

prasunanand commented 3 years ago

@pkspyder007 CI is failing. Can you debug ?

pkspyder007 commented 3 years ago

@prasunanand According to my checking ,CI is failing due to the bundler version compatibility. Adding a Gemlock file similar to package.lock in npm should lock all the version of gems and bundler we are using.

pkspyder007 commented 3 years ago

@prasunanand If I add the Gemfile.lock the 5th test passes but the travis CI build fails and on removing Gemfile.lock the 5th test fails. You can see the result here I read the error message in Travis build log I think the Issue is only with versions that we use of bundler and ruby. So this would be a tradeoff between keeping the lock file vs not.

pkspyder007 commented 3 years ago

@prasunanand @Uditgulati Any updates on this PR?