Closed bf4 closed 10 years ago
Benjamin,
Thanks for your mail! I didn´t know about the license in gemspec. I´ll add it to my next mdarray version. Actually, is there a way to upload the same gem, with the same version number again so I don´t have to create a new version for the same gem? MDArray if free for all uses. Do you know the best licensing for that?
Thanks,
Rodrigo
On Wed, Aug 7, 2013 at 4:08 PM, Benjamin Fleischer <notifications@github.com
wrote:
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspechttp:t/docs.rubygems.org/read/chapter/20#licenseof your last release.
via e.g.
spec.license = 'MIT'
or
spec.licenses = ['MIT', 'GPL-2']
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can image, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem licensehttps://rubygems.org/gems/rails .
There is even a License Finder gemhttps://github.com/pivotal/LicenseFinderto help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license http://opensource.org/licenses(sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool http://choosealicense.com/. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code. Here's a list of the license names I've found and their frequencieshttps://github.com/bf4/gemproject/blob/master/license_usage.csv
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :)https://github.com/bf4/gemproject/issues/1. See the previous link or my blog post about this project for more informationhttp://www.benjaminfleischer.com/2013/07/12/make-the-world-a-better-place-put-a-license-in-your-gemspec/ .
— Reply to this email directly or view it on GitHubhttps://github.com/rbotafogo/mdarray/issues/3 .
Rodrigo Botafogo Integrando TI ao seu negócio
@rbotafogo A good one is the MIT license. It's a very common one in the open source community due to its simplicity (it's small enough for you to be able to READ it!!). :)
Carlos,
Thanks... I´ll do it!
Rodrigo
On Wed, Aug 7, 2013 at 4:36 PM, Carlos Agarie notifications@github.comwrote:
@rbotafogo https://github.com/rbotafogo A good one is the MIT licensehttp://opensource.org/licenses/MIT. It's a very common one in the open source community due to its simplicity (it's small enough for you to be able to READ it!!). :)
— Reply to this email directly or view it on GitHubhttps://github.com/rbotafogo/mdarray/issues/3#issuecomment-22273404 .
Rodrigo Botafogo Integrando TI ao seu negócio 21-3010-4802/11-3010-1802
@rbotafogo Once a gem is pushed to rubygems.org you can't overwrite it. (You can yank it to prevent a gem install from getting it, but that hardly seems necessary). It's fine just to specify a license for the next release. Now worries. Thanks!
MDArray version 0.5.5 has Just been released. MDArray is a multi dimensional array implemented for JRuby inspired by NumPy (www.numpy.org) and Masahiro Tanaka´s Narray ( narray.rubyforge.org). MDArray stands on the shoulders of Java-NetCDF and Parallel Colt. At this point MDArray has libraries for linear algebra, mathematical, trigonometric and descriptive statistics methods.
NetCDF-Java Library is a Java interface to NetCDF files, as well as to many other types of scientific data formats. It is developed and distributed by Unidata ( http://www.unidata.ucar.edu).
Parallel Colt ( https://sites.google.com/site/piotrwendykier/software/parallelcolt is a multithreaded version of Colt (http://acs.lbl.gov/software/colt/). Colt provides a set of Open Source Libraries for High Performance Scientific and Technical Computing in Java. Scientific and technical computing is characterized by demanding problem sizes and a need for high performance at reasonably small memory footprint.
This version of MDArray introduces class MDMatrix. MDMatrix is a matrix class wrapping many linear algebra methods from Parallel Colt (see below). MDMatrix support only the following types: i) int; ii) long; iii) float and iv) double.
Differently from other libraries, in which matrix is a subclass of array, MDMatrix is a twin class of MDArray. MDMatrix is a twin class of MDArray as every time an MDMatrix is instantiated, an MDArray class is also instantiated. In reality, there is only one backing store that can be viewed by either MDMatrix or MDArray.
Creation of MDMatrix follows the same API as MDArray API. For instance, creating a double square matrix of size 5 x 5 can be done by:
matrix = MDMatrix.double([5, 5], [2.0, 0.0, 8.0, 6.0, 0.0,\
1.0, 6.0, 0.0, 1.0, 7.0,\
5.0, 0.0, 7.0, 4.0, 0.0,\
7.0, 0.0, 8.0, 5.0, 0.0,\
0.0, 10.0, 0.0, 0.0, 7.0])
Creating an int matrix filled with zero can be done by:
matrix = MDMatrix.int([4, 3])
MDMatrix also supports creation based on methods such as fromfunction, linspace, init_with, arange, typed_arange and ones:
array = MDArray.typed_arange("double", 0, 15)
array = MDMatrix.fromfunction("double", [4, 4]) { |x, y| x + y }
An MDMatrix can also be created from an MDArray as follows:
d2 = MDArray.typed_arange("double", 0, 15)
double_matrix = MDMatrix.from_mdarray(d2)
An MDMatrix can only be created from MDArrays of one, two or three dimensions. However, one can take a view from an MDArray to create an MDMatrix, as long as the view is at most three dimensional:
# Instantiate an MDArray and shape it with 4 dimensions
> d1 = MDArray.typed_arange("double", 0, 420)
> d1.reshape!([5, 4, 3, 7])
# slice the array, getting a three dimensional array and from that,
make a matrix
matrix = MDMatrix.from_mdarray(d1.slice(0, 0))
get a region from the array, with the first two dimensions of size 0,
reduce it to a
size two array and then build a two dimensional matrix
matrix = MDMatrix.from_mdarray(d1.region(:spec => "0:0, 0:0, 0:2, 0:6").reduce)
printing the above two dimensional matrix gives us:
> matrix.print
3 x 7 matrix
0,00000 1,00000 2,00000 3,00000 4,00000 5,00000 6,00000
7,00000 8,00000 9,00000 10,0000 11,0000 12,0000 13,0000
14,0000 15,0000 16,0000 17,0000 18,0000 19,0000 20,0000
Every MDMatrix instance has a twin MDArray instance that uses the same backing store. This allows the user to treat the data as either a matrix or an array and use methods either from matrix or array. The above matrix can be printed as an array:
> matrix.mdarray.print
[[0.00 1.00 2.00 3.00 4.00 5.00 6.00]
[7.00 8.00 9.00 10.00 11.00 12.00 13.00]
[14.00 15.00 16.00 17.00 18.00 19.00 20.00]]
With an MDMatrix, many linear algebra methods can be easily calculated:
# basic operations on matrix can be done, such as, ‘+’, ‘-‘,
´*’, ‘/’
> a = MDMatrix.double([4, 4])
> a.fill(2.5)
> make a 4 x 4 matrix ´b´ from a given function (block)
> b = MDMatrix.fromfunction("double", [4, 4]) { |x, y| x + y }
# add both matrices
> c = a + b
# multiply by scalar
> c = a \* 2
# divide two matrices. Matrix ´b´ has to be non-singular, otherwise
an exception is
# generate a non-singular matrix from a given matrix
> b.generate_non_singular!
> c = a / b
Linear algebra methods:
# create a matrix with the given data
> pos = MDArray.double([3, 3], [4, 12, -16, 12, 37, -43, -16, -43, 98])
> matrix = MDMatrix.from_mdarray(pos)
# Cholesky decomposition from wikipedia example
> chol = matrix.chol
> assert_equal(2, chol[0, 0])
> assert_equal(6, chol[1, 0])
> assert_equal(-8, chol[2, 0])
> assert_equal(5, chol[2, 1])
> assert_equal(3, chol[2, 2])
All other linear algebra methods are called the same way.
MDArray subscribes fully to the SciRuby Manifesto (http://sciruby.com/).
“Ruby has for some time had no equivalent to the beautifully constructed NumPy, SciPy, and matplotlib libraries for Python.
We believe that the time for a Ruby science and visualization package has come. Sometimes when a solution of sugar and water becomes super-saturated, from it precipitates a pure, delicious, and diabetes-inducing crystal of sweetness, induced by no more than the tap of a finger. So is occurring now, we believe, with numeric and visualization libraries for Ruby.â€
Contributors are welcome.
Rodrigo Botafogo Integrando TI ao seu negócio
Awesome, thanks! :rainbow:
thanks for the tip! If you can test it, would be great!
Cheers,
Rodrigo
On Tue, Nov 19, 2013 at 1:08 PM, Benjamin Fleischer < notifications@github.com> wrote:
Awesome, thanks! [image: :rainbow:]
— Reply to this email directly or view it on GitHubhttps://github.com/rbotafogo/mdarray/issues/3#issuecomment-28796971 .
Rodrigo Botafogo Integrando TI ao seu negócio 21-3010-4802/11-3010-1802
I don't have a use case, but it works for me on osx mavricks with jruby 1.7.5
Sounds good! Great.
On Tue, Nov 19, 2013 at 1:27 PM, Benjamin Fleischer < notifications@github.com> wrote:
I don't have a use case, but it works for me on osx mavricks with jruby 1.7.5
— Reply to this email directly or view it on GitHubhttps://github.com/rbotafogo/mdarray/issues/3#issuecomment-28798821 .
Rodrigo Botafogo Integrando TI ao seu negócio 21-3010-4802/11-3010-1802
RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.
via e.g.
Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can image, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.
There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.
I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!
Appendix:
If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code. Here's a list of the license names I've found and their frequencies
p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.