I have a question about the ethical considerations of contributing. I have never contributed to open source software before.
I have written a prototype function that implements the Phillips-Peron unit root test for time series. It works extremely well with respect to matching Phillips-Peron test results from R on an extensive number of test cases, but it uses a lot of code from Benjamin Born’s ADFTest, mostly his efficient implementation of MacKinnon’s method for computing the critical values and the p-values. Should I just include an acknowledgement and his copyright for that portion of the code, or should I contact him directly about how to proceed?
You can see that @BenjaminBorn holds the copyright on the implementation, but has granted you (and everyone) a license to not only use the code but also modify it and distribute such modifications. There’s really only two conditions: acknowledge that copyright (and the license itself) in any copies or derived works and don’t sue him.
This is the crux of how open source works: you’ve already been granted permission to work with it, modify it, and redistribute it! The exact terms of this permission are called the license, and there are many such permutations that govern exactly what you can and can’t do. The particular license here is called the “MIT License” and is what many Julia packages use.
Contacting the author is a good practice – people want to know where their code appears.
As an ethical matter, the License that Benjamin Born grants explicitly permits you to incorporate that source code as long as you always distribute that same license with your work (the license then applies to his work as a constituent of yours, it does not apply to your work outside of that).
# augmented_dickey_fuller.jl
# (Augmented) Dickey-Fuller unit root test
#
# Copyright (C) 2017 Benjamin Born
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Is the implication here that I need to keep a copy of the license for every package dependency I use in my package and then create a new license file for the package as a whole (which may or may not be different from the copied licenses)? How would I distinguish what license applies to what code, especially if the main package is going to have a copyright and no license?
No, the license on your package covers the code of that package, not of its dependencies. So your package can depend on other packages irrespective of their license. It’s up to the user to check they are happy with the licenses of all installed packages.
OTOH if you copy code into your package, you might be bound by that code’s license to license your own package in a certain way.
I have a related query - what is the rule/licencing/custom for code that someone responds as an answer to a question on the forum that you want to use in a package?
Very helpful @mbauman - thanks! So in a practical sense, does this mean one should link to the discourse post with that volunteered code in your package documentation ?
I’ve decided to email Dr. Born and see what he has to say. Despite the very open nature of the license, it seems like the polite thing to do in this case.
My thanks to everyone who responded, including the people who expanded the original topic - this is all good info to know.