From 8e96ed765882b1909b55702c6f64cac03862ecd0 Mon Sep 17 00:00:00 2001 From: ehennestad Date: Thu, 16 Jul 2026 19:46:45 +0200 Subject: [PATCH 1/6] docs: add third-party notices for climatedatastore-derived code Several task and utility functions plus the release workflow were adapted from mathworks/climatedatastore, whose license requires retaining the copyright notice, conditions, and disclaimer with redistributed source, and keeps derivatives under its own terms rather than MIT. - Add THIRD_PARTY_NOTICES.md listing the adapted files and reproducing the climatedatastore license verbatim - Scope the MIT grant in LICENSE to exclude the adapted portions - Normalize per-file attribution headers to name the specific source file and point at THIRD_PARTY_NOTICES.md, adding headers to codecheckToolbox.m and testToolbox.m which lacked them Co-Authored-By: Claude Fable 5 --- .github/workflows/create_release.yml | 1 + LICENSE | 3 ++ THIRD_PARTY_NOTICES.md | 52 +++++++++++++++++++ code/+matbox/+tasks/codecheckToolbox.m | 5 ++ .../+tasks/createTestedWithBadgeforToolbox.m | 3 +- code/+matbox/+tasks/packageToolbox.m | 1 + code/+matbox/+tasks/testToolbox.m | 6 ++- code/+matbox/+utility/updateVersionNumber.m | 1 + code/+matbox/+utility/writeBadgeJSONFile.m | 3 +- 9 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 THIRD_PARTY_NOTICES.md diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 601733e..db4b25f 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -1,5 +1,6 @@ # Test the toolbox across all supported releases of MATLAB, package toolbox, create release # Adapted from: https://github.com/mathworks/climatedatastore/blob/main/.github/workflows/release.yml +# See THIRD_PARTY_NOTICES.md in the repository root for license terms. name: Create new release diff --git a/LICENSE b/LICENSE index bf5b98c..915e239 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,6 @@ 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. + +Portions of this software are adapted from third-party code and are subject +to the original license terms; see THIRD_PARTY_NOTICES.md. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 0000000..6965191 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,52 @@ +# Third-Party Notices + +MatBox is licensed under the MIT License (see [LICENSE](LICENSE)), with the +exception of the portions listed below, which are adapted from third-party +code and remain subject to the original license terms reproduced here. + +## mathworks/climatedatastore + +The following files are adapted from build utilities and workflows in +[mathworks/climatedatastore](https://github.com/mathworks/climatedatastore), +Copyright (c) 2021-2022, The MathWorks, Inc.: + +| MatBox file | Adapted from | +|---|---| +| `code/+matbox/+tasks/testToolbox.m` | `buildUtilities/testToolbox.m` | +| `code/+matbox/+tasks/codecheckToolbox.m` | `buildUtilities/codecheckToolbox.m` | +| `code/+matbox/+tasks/packageToolbox.m` | `buildUtilities/packageToolbox.m` | +| `code/+matbox/+tasks/createTestedWithBadgeforToolbox.m` | `buildUtilities/badgesforToolbox.m` | +| `code/+matbox/+utility/updateVersionNumber.m` | `buildUtilities/packageToolbox.m` | +| `code/+matbox/+utility/writeBadgeJSONFile.m` | `buildUtilities/writeBadgeJSONFile.m` | +| `.github/workflows/create_release.yml` | `.github/workflows/release.yml` | + +These portions are distributed under the following license. Note that, per +condition 3, modifications and derivatives of this code are licensed solely +for use in conjunction with MathWorks products and service offerings; MatBox +is a MATLAB toolbox and is used exclusively with MATLAB. + +```text +Copyright (c) 2021-2022, The MathWorks, Inc. +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +3. In all cases, the software is, and all modifications and derivatives of + the software shall be, licensed to you solely for use in conjunction with + MathWorks products and service offerings. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +``` diff --git a/code/+matbox/+tasks/codecheckToolbox.m b/code/+matbox/+tasks/codecheckToolbox.m index 4432490..853cb48 100644 --- a/code/+matbox/+tasks/codecheckToolbox.m +++ b/code/+matbox/+tasks/codecheckToolbox.m @@ -1,4 +1,9 @@ function issues = codecheckToolbox(projectRootDir, options) +% codecheckToolbox - Run MATLAB code analysis on project source files +% +% Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/codecheckToolbox.m +% See THIRD_PARTY_NOTICES.md in the repository root for license terms. + arguments projectRootDir (1,1) string {mustBeFolder} options.CreateBadge (1,1) logical = true diff --git a/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m b/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m index d812a9c..29bdf18 100644 --- a/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m +++ b/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m @@ -2,7 +2,8 @@ function createTestedWithBadgeforToolbox(versionNumber, projectRootDirectory) %createTestedWithBadgesforToolbox - Take the test reports from the runs against % multiple MATLAB releases, and generate the "Tested with" badge % -% Adapted from: https://github.com/mathworks/climatedatastore/tree/main/buildUtilities +% Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/badgesforToolbox.m +% See THIRD_PARTY_NOTICES.md in the repository root for license terms. arguments versionNumber (1,1) string diff --git a/code/+matbox/+tasks/packageToolbox.m b/code/+matbox/+tasks/packageToolbox.m index 2b57f0f..f22a515 100644 --- a/code/+matbox/+tasks/packageToolbox.m +++ b/code/+matbox/+tasks/packageToolbox.m @@ -13,6 +13,7 @@ % the specific 3 part semantic version (i.e. "2.3.4") to use. % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/packageToolbox.m +% See THIRD_PARTY_NOTICES.md in the repository root for license terms. % Todo: % [ ] Create a matlab script that fills in toolbox options for path diff --git a/code/+matbox/+tasks/testToolbox.m b/code/+matbox/+tasks/testToolbox.m index 9862e08..f450a53 100644 --- a/code/+matbox/+tasks/testToolbox.m +++ b/code/+matbox/+tasks/testToolbox.m @@ -1,6 +1,8 @@ function testToolbox(projectRootDirectory, options) - %RUNTESTWITHCODECOVERAGE Summary of this function goes here - % Detailed explanation goes here + % testToolbox - Run project test suites with coverage and test reports + % + % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/testToolbox.m + % See THIRD_PARTY_NOTICES.md in the repository root for license terms. arguments projectRootDirectory (1,1) string {mustBeFolder} diff --git a/code/+matbox/+utility/updateVersionNumber.m b/code/+matbox/+utility/updateVersionNumber.m index 3c5dc34..294a1cd 100644 --- a/code/+matbox/+utility/updateVersionNumber.m +++ b/code/+matbox/+utility/updateVersionNumber.m @@ -2,6 +2,7 @@ % updateVersionNumber - Utility function to update a version number % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/packageToolbox.m +% See THIRD_PARTY_NOTICES.md in the repository root for license terms. arguments previousVersion string {mustBeTextScalar} = ""; diff --git a/code/+matbox/+utility/writeBadgeJSONFile.m b/code/+matbox/+utility/writeBadgeJSONFile.m index 772106c..f9d3d25 100644 --- a/code/+matbox/+utility/writeBadgeJSONFile.m +++ b/code/+matbox/+utility/writeBadgeJSONFile.m @@ -34,7 +34,8 @@ function writeBadgeJSONFile(label, message, color, projectRootDirectory, options % necessary. The badge information is encoded as a JSON string and written % to a file in the specified directory. % -% CREDIT: https://github.com/mathworks/climatedatastore/tree/main/buildUtilities +% Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/writeBadgeJSONFile.m +% See THIRD_PARTY_NOTICES.md in the repository root for license terms. arguments label (1,1) string From af6748e55a4e91cf56b6bf4e1e05ad7b31aeb89d Mon Sep 17 00:00:00 2001 From: ehennestad Date: Thu, 16 Jul 2026 21:48:07 +0200 Subject: [PATCH 2/6] feat: package LICENSE and THIRD_PARTY_NOTICES.md into the mltbx Uses the RootFilesToPackage mechanism from #61 so the license and third-party notices ship inside packaged toolbox releases, covering the binary-redistribution condition of the climatedatastore license. Co-Authored-By: Claude Fable 5 --- tools/MLToolboxInfo.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/MLToolboxInfo.json b/tools/MLToolboxInfo.json index 14a035b..9a36782 100644 --- a/tools/MLToolboxInfo.json +++ b/tools/MLToolboxInfo.json @@ -1,5 +1,6 @@ { "Namespace" : "matbox", + "RootFilesToPackage": ["LICENSE", "THIRD_PARTY_NOTICES.md"], "ToolboxOptions": { "Identifier": "dedfd78a-8fd1-4fca-9db3-f5eff64c7a88", "ToolboxName": "MatBox", From e68a59e1d5193bcd501a100c5f712fe2423850ae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 19:50:44 +0000 Subject: [PATCH 3/6] Update GitHub badges --- .github/badges/tests.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/badges/tests.svg b/.github/badges/tests.svg index 3433011..b2979d5 100644 --- a/.github/badges/tests.svg +++ b/.github/badges/tests.svg @@ -1 +1 @@ -teststests21 passed21 passed \ No newline at end of file +teststests23 passed23 passed \ No newline at end of file From 7aa1119a10d7052921b9d9c18a8d461c4c4cfdbc Mon Sep 17 00:00:00 2001 From: ehennestad Date: Thu, 16 Jul 2026 22:35:47 +0200 Subject: [PATCH 4/6] docs: make notices reference distribution-agnostic 'Repository root' is wrong for users who installed the .mltbx, where THIRD_PARTY_NOTICES.md sits at the installed toolbox root instead. Co-Authored-By: Claude Fable 5 --- .github/workflows/create_release.yml | 2 +- code/+matbox/+tasks/codecheckToolbox.m | 2 +- code/+matbox/+tasks/createTestedWithBadgeforToolbox.m | 2 +- code/+matbox/+tasks/packageToolbox.m | 2 +- code/+matbox/+tasks/testToolbox.m | 2 +- code/+matbox/+utility/updateVersionNumber.m | 2 +- code/+matbox/+utility/writeBadgeJSONFile.m | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index db4b25f..13fdc45 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -1,6 +1,6 @@ # Test the toolbox across all supported releases of MATLAB, package toolbox, create release # Adapted from: https://github.com/mathworks/climatedatastore/blob/main/.github/workflows/release.yml -# See THIRD_PARTY_NOTICES.md in the repository root for license terms. +# See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. name: Create new release diff --git a/code/+matbox/+tasks/codecheckToolbox.m b/code/+matbox/+tasks/codecheckToolbox.m index 853cb48..45d6f64 100644 --- a/code/+matbox/+tasks/codecheckToolbox.m +++ b/code/+matbox/+tasks/codecheckToolbox.m @@ -2,7 +2,7 @@ % codecheckToolbox - Run MATLAB code analysis on project source files % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/codecheckToolbox.m -% See THIRD_PARTY_NOTICES.md in the repository root for license terms. +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments projectRootDir (1,1) string {mustBeFolder} diff --git a/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m b/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m index 29bdf18..7cc46d4 100644 --- a/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m +++ b/code/+matbox/+tasks/createTestedWithBadgeforToolbox.m @@ -3,7 +3,7 @@ function createTestedWithBadgeforToolbox(versionNumber, projectRootDirectory) % multiple MATLAB releases, and generate the "Tested with" badge % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/badgesforToolbox.m -% See THIRD_PARTY_NOTICES.md in the repository root for license terms. +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments versionNumber (1,1) string diff --git a/code/+matbox/+tasks/packageToolbox.m b/code/+matbox/+tasks/packageToolbox.m index f22a515..32adefc 100644 --- a/code/+matbox/+tasks/packageToolbox.m +++ b/code/+matbox/+tasks/packageToolbox.m @@ -13,7 +13,7 @@ % the specific 3 part semantic version (i.e. "2.3.4") to use. % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/packageToolbox.m -% See THIRD_PARTY_NOTICES.md in the repository root for license terms. +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. % Todo: % [ ] Create a matlab script that fills in toolbox options for path diff --git a/code/+matbox/+tasks/testToolbox.m b/code/+matbox/+tasks/testToolbox.m index f450a53..de11b1c 100644 --- a/code/+matbox/+tasks/testToolbox.m +++ b/code/+matbox/+tasks/testToolbox.m @@ -2,7 +2,7 @@ function testToolbox(projectRootDirectory, options) % testToolbox - Run project test suites with coverage and test reports % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/testToolbox.m - % See THIRD_PARTY_NOTICES.md in the repository root for license terms. + % See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments projectRootDirectory (1,1) string {mustBeFolder} diff --git a/code/+matbox/+utility/updateVersionNumber.m b/code/+matbox/+utility/updateVersionNumber.m index 294a1cd..f939241 100644 --- a/code/+matbox/+utility/updateVersionNumber.m +++ b/code/+matbox/+utility/updateVersionNumber.m @@ -2,7 +2,7 @@ % updateVersionNumber - Utility function to update a version number % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/packageToolbox.m -% See THIRD_PARTY_NOTICES.md in the repository root for license terms. +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments previousVersion string {mustBeTextScalar} = ""; diff --git a/code/+matbox/+utility/writeBadgeJSONFile.m b/code/+matbox/+utility/writeBadgeJSONFile.m index f9d3d25..b5189b0 100644 --- a/code/+matbox/+utility/writeBadgeJSONFile.m +++ b/code/+matbox/+utility/writeBadgeJSONFile.m @@ -35,7 +35,7 @@ function writeBadgeJSONFile(label, message, color, projectRootDirectory, options % to a file in the specified directory. % % Adapted from: https://github.com/mathworks/climatedatastore/blob/main/buildUtilities/writeBadgeJSONFile.m -% See THIRD_PARTY_NOTICES.md in the repository root for license terms. +% See the THIRD_PARTY_NOTICES.md file distributed with MatBox for license terms. arguments label (1,1) string From 1351766814893c54029a18ddb5e9924f0034c389 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 20:37:53 +0000 Subject: [PATCH 5/6] Update GitHub badges --- .github/badges/tests.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/badges/tests.svg b/.github/badges/tests.svg index b2979d5..3433011 100644 --- a/.github/badges/tests.svg +++ b/.github/badges/tests.svg @@ -1 +1 @@ -teststests23 passed23 passed \ No newline at end of file +teststests21 passed21 passed \ No newline at end of file From 1f6d1eb82ef45518c5bd729f21d25b2dd0dbf482 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Jul 2026 20:38:03 +0000 Subject: [PATCH 6/6] Update GitHub badges --- .github/badges/tests.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/badges/tests.svg b/.github/badges/tests.svg index 3433011..b2979d5 100644 --- a/.github/badges/tests.svg +++ b/.github/badges/tests.svg @@ -1 +1 @@ -teststests21 passed21 passed \ No newline at end of file +teststests23 passed23 passed \ No newline at end of file