Skip to content

Commit a6f4d2b

Browse files
authored
Merge pull request #163 from ImperialCollegeLondon/feat/package
feat: Convert MATLAB Project to MATLAB Package
2 parents b62cf11 + 6f9d982 commit a6f4d2b

File tree

1,549 files changed

+173
-4469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,549 files changed

+173
-4469
lines changed

.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/package.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ jobs:
1717
uses: matlab-actions/[email protected]
1818
with:
1919
release: R2025a
20-
- name: Load Environment Variables
21-
uses: aarcangeli/[email protected]
20+
- name: Load version from package
21+
run: |
22+
echo "MAG_DATA_VISUALIZATION_VERSION=$(jq -r .version resources/mpackage.json)" >> $GITHUB_ENV
2223
- name: Validate version with tag
2324
run: |
2425
if [ "v${{ env.MAG_DATA_VISUALIZATION_VERSION }}" != "${{ github.ref_name }}" ]; then

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repos:
1111
- id: trailing-whitespace
1212
- id: pretty-format-json
1313
args: [--autofix, --indent, "4"]
14-
exclude: resources/codeAnalyzerConfiguration.json|tests/unit/data/imap/test_data/invalid.json
14+
exclude: resources/codeAnalyzerConfiguration.json|resources/mpackage.json|tests/unit/data/imap/test_data/invalid.json
1515
- repo: https://github.com/python-jsonschema/check-jsonschema
1616
rev: "0.33.0"
1717
hooks:

MAGDataVisualization.prj

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion

buildfile.m

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
function plan = buildfile()
22
% BUILDFILE File invoked by automated build.
33

4-
% Create a plan from task functions.
54
plan = buildplan();
65

7-
% Get current project.
86
if isMATLABReleaseOlderThan("R2025a")
97

10-
project = matlab.project.currentProject();
8+
warning("mag:buildtool:path", "MATLAB release ""%s"" not supported for development purposes. " + ...
9+
"Adding all folders to the path for testing purposes.", matlabRelease().Release);
1110

12-
if isempty(project) || ~isequal(project.Name, "MAG Data Visualization")
11+
% Brute-force add all folders to the path.
12+
addpath(genpath(plan.RootFolder));
13+
else
14+
15+
% Open package if not already open.
16+
package = matlab.mpm.Package(plan.RootFolder);
1317

14-
project = matlab.project.loadProject("MAGDataVisualization.prj");
15-
restoreProject = onCleanup(@() project.close());
18+
if ~package.Installed
19+
addpath(join(fullfile(plan.RootFolder, [package.Folders.Path]), pathsep()));
1620
end
17-
else
18-
project = plan.Project;
1921
end
2022

2123
% Add the "check" task to identify code issues.
@@ -34,9 +36,13 @@
3436
TestResults = fullfile("artifacts/results.xml"), ...
3537
CodeCoverageResults = fullfile("artifacts/coverage.xml"));
3638

39+
if ~isMATLABReleaseOlderThan("R2025a")
40+
plan("test").RunOnlyImpactedTests = true;
41+
end
42+
3743
% Add the "package" task to create toolbox.
3844
plan("package") = mag.buildtool.task.PackageTask(Description = "Package code into toolbox", ...
39-
ProjectRoot = project.RootFolder, ...
45+
PackageRoot = plan.RootFolder, ...
4046
ToolboxPath = fullfile("artifacts/MAG Data Visualization.mltbx"));
4147

4248
% Add the "clean" task to delete output of all tasks.

icons/logo.png

62.7 KB

icons/mag.png

459 Bytes

project/runProjectTests.m

Lines changed: 0 additions & 1 deletion
This file was deleted.

resources/extensions.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"mw.desktop.quickAccess": {
3+
"items": [
4+
{
5+
"action": {
6+
"callback": "DataVisualization",
7+
"description": "Open MAG Data Visualization App",
8+
"icon": "../icons/mag.png",
9+
"text": "Data Visualization App"
10+
},
11+
"name": "mag.ui.DataVisualization",
12+
"type": "PushButton"
13+
}
14+
]
15+
}
16+
}

resources/mpackage.json

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
{
2+
"name": "MAGDataVisualization",
3+
"version": "8.0.0",
4+
"id": "69962df8-e93e-47cd-a1d6-766ad3e9da8a",
5+
"formerNames": [],
6+
"displayName": "MAG Data Visualization",
7+
"summary": "MAG data visualization toolbox",
8+
"description": "MAG toolbox for processing and visualizing magnetometer data and housekeeping",
9+
"provider": {
10+
"name": "Michele Facchinelli",
11+
"organization": "Imperial College London",
12+
"email": "",
13+
"url": "https://www.imperial.ac.uk/space-and-atmospheric-physics/research/areas/space-magnetometer-laboratory/"
14+
},
15+
"folders": [
16+
{
17+
"path": "app",
18+
"languages": [
19+
"matlab"
20+
]
21+
},
22+
{
23+
"path": "app/core",
24+
"languages": [
25+
"matlab"
26+
]
27+
},
28+
{
29+
"path": "src/visualize",
30+
"languages": [
31+
"matlab"
32+
]
33+
},
34+
{
35+
"path": "tests/tool",
36+
"languages": [
37+
"matlab"
38+
]
39+
},
40+
{
41+
"path": "app/mission/bart",
42+
"languages": [
43+
"matlab"
44+
]
45+
},
46+
{
47+
"path": "app/mission/hs",
48+
"languages": [
49+
"matlab"
50+
]
51+
},
52+
{
53+
"path": "app/mission/imap",
54+
"languages": [
55+
"matlab"
56+
]
57+
},
58+
{
59+
"path": "src/analyze",
60+
"languages": [
61+
"matlab"
62+
]
63+
},
64+
{
65+
"path": "src/data",
66+
"languages": [
67+
"matlab"
68+
]
69+
},
70+
{
71+
"path": "src/io",
72+
"languages": [
73+
"matlab"
74+
]
75+
},
76+
{
77+
"path": "src/mission/bart",
78+
"languages": [
79+
"matlab"
80+
]
81+
},
82+
{
83+
"path": "src/mission/hs",
84+
"languages": [
85+
"matlab"
86+
]
87+
},
88+
{
89+
"path": "src/mission/imap",
90+
"languages": [
91+
"matlab"
92+
]
93+
},
94+
{
95+
"path": "src/transform",
96+
"languages": [
97+
"matlab"
98+
]
99+
},
100+
{
101+
"path": "src/utility",
102+
"languages": [
103+
"matlab"
104+
]
105+
}
106+
],
107+
"dependencies": [],
108+
"releaseCompatibility": ">=R2024a",
109+
"schemaVersion": "1.1.0"
110+
}

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/2XR1rqkisv4JiDSp4NoYOETmJYkd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/2XR1rqkisv4JiDSp4NoYOETmJYkp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/3j8csAofpexFJlNRCUUrYl1Iybgd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/3j8csAofpexFJlNRCUUrYl1Iybgp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/DhHxlsndiiSk8V6_Lk109UF-Q98d.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/DhHxlsndiiSk8V6_Lk109UF-Q98p.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/TDZGhqmFdgYMrWBMxQ7UZbyglG4d.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/TDZGhqmFdgYMrWBMxQ7UZbyglG4p.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/TaueSUHYYHUPqpzXeyCv8kHIZTcd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/TaueSUHYYHUPqpzXeyCv8kHIZTcp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/_-0R_KaiZoz408Rf04zk2Lgu3TAd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/_-0R_KaiZoz408Rf04zk2Lgu3TAp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/mwcWrpK1rOnvtyszHdsHVvoYA-Id.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-h2L0hF035doqVvcUhcvKfD_LcU/mwcWrpK1rOnvtyszHdsHVvoYA-Ip.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-xiHXLgep6e9m96daAEm0-L1Wec/LoW63jl3aG6837ji1GRBZGm3Ygod.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/-xiHXLgep6e9m96daAEm0-L1Wec/LoW63jl3aG6837ji1GRBZGm3Ygop.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-xiHXLgep6e9m96daAEm0-L1Wec/_f8KViu_lHc2_YcgOKtu9P9X3EQd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/-xiHXLgep6e9m96daAEm0-L1Wec/_f8KViu_lHc2_YcgOKtu9P9X3EQp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/G7Tou7bCzunci-q2BGcVF7L8HIQd.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/G7Tou7bCzunci-q2BGcVF7L8HIQp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/MSxBw6GrfJOFM5AYBCnYwrNFVrgd.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/MSxBw6GrfJOFM5AYBCnYwrNFVrgp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/rO4H1Cn1Et8xUCweY1TxgJRToywd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/rO4H1Cn1Et8xUCweY1TxgJRToywp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/u5aE3w94M9YBP4aGtOhqqKDSF-sd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/05RqCgb6grcoB6zrZo62jYqqVFs/u5aE3w94M9YBP4aGtOhqqKDSF-sp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0P8_nylhcb4MEvTgfSFt0P8POKY/0Sh85qJGOQk99Uh0HvA9IDnMPZUd.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0P8_nylhcb4MEvTgfSFt0P8POKY/0Sh85qJGOQk99Uh0HvA9IDnMPZUp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0P8_nylhcb4MEvTgfSFt0P8POKY/tgJ7Qy0KznYP8nE3WIoAQxU8Gf8d.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0P8_nylhcb4MEvTgfSFt0P8POKY/tgJ7Qy0KznYP8nE3WIoAQxU8Gf8p.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/T-hrizZH-vifPt4wpBekMxw7BKId.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/T-hrizZH-vifPt4wpBekMxw7BKIp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/_jbQbKK_CttG9HzgD6KEcWxkRoId.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/_jbQbKK_CttG9HzgD6KEcWxkRoIp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/aO3rYPB0RiqFEaw3TxixTsYh_P0d.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/aO3rYPB0RiqFEaw3TxixTsYh_P0p.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/hkB0Vz1jGHnQ1EaF8YioAaeIXpYd.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

resources/project/0dbhqkzNwmFOH66h8A6rWSqfl9Y/hkB0Vz1jGHnQ1EaF8YioAaeIXpYp.xml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)