Skip to content

Commit 8c772d3

Browse files
authored
Matlab AT release 2.3 (#394)
* release 2.3 * release 2.3 * updated project * updated project * Version number in Matlab sidebar * Small fix in installation doc * clean relase script * Added instructions to get correct plots in help files
1 parent be01e0c commit 8c772d3

File tree

95 files changed

+544
-274
lines changed

Some content is hidden

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

95 files changed

+544
-274
lines changed

ToolboxPackagingConfiguration.prj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
2-
<configuration build-checksum="24182281" file="/Users/famille/dev/libraries/at/ToolboxPackagingConfiguration.prj" location="/Users/famille/dev/libraries/at" name="ToolboxPackagingConfiguration" target="target.toolbox" target-name="Package Toolbox">
2+
<configuration build-checksum="770107251" file="/Users/famille/dev/libraries/at/ToolboxPackagingConfiguration.prj" location="/Users/famille/dev/libraries/at" name="ToolboxPackagingConfiguration" target="target.toolbox" target-name="Package Toolbox">
33
<param.appname>Accelerator Toolbox</param.appname>
44
<param.authnamewatermark>atcollab</param.authnamewatermark>
55
<param.email />
@@ -15,7 +15,7 @@ compute accelerator parameters and beam properties.
1515
AT is based on a 6-D modular tracking engine written in C/C++ for efficiency. Lattice manipulation and computation of accelerator physics parameters are performed in MATLAB.
1616

1717
View on GitHub</param.description>
18-
<param.screenshot>${PROJECT_ROOT}/developer/mdoc/AT.png</param.screenshot>
18+
<param.screenshot>${PROJECT_ROOT}/developer/matlab/AT.png</param.screenshot>
1919
<param.version>2.3</param.version>
2020
<param.output>${PROJECT_ROOT}/Accelerator Toolbox.mltbx</param.output>
2121
<param.products.name />
@@ -88,7 +88,7 @@ docs/p</param.exclude.filters>
8888
<param.exported.on.package>false</param.exported.on.package>
8989
<param.required.addons>
9090
<requiredaddons>
91-
<requiredAddOn earliest="earliest" fromRepository="true" id="e562b2d1-4a80-11e4-9553-005056977bd0" include="false" latest="latest">export_fig(2)</requiredAddOn>
91+
<requiredAddOn earliest="earliest" fromRepository="true" id="e562b2d1-4a80-11e4-9553-005056977bd0" include="false" latest="latest">export_fig</requiredAddOn>
9292
</requiredaddons>
9393
</param.required.addons>
9494
<param.matlab.project.id>25a6ccb8-d1d3-4459-847b-7335e59e8646</param.matlab.project.id>
@@ -148,7 +148,7 @@ docs/p</param.exclude.filters>
148148
</build-deliverables>
149149
<workflow />
150150
<matlab>
151-
<root>/Applications/MATLAB_R2021b.app</root>
151+
<root>/Applications/MATLAB_R2022a.app</root>
152152
<toolboxes>
153153
<toolbox name="matlabcoder" />
154154
</toolboxes>
@@ -167,7 +167,7 @@ docs/p</param.exclude.filters>
167167
<vista>false</vista>
168168
<linux>false</linux>
169169
<solaris>false</solaris>
170-
<osver>12.2</osver>
170+
<osver>12.3.1</osver>
171171
<os32>false</os32>
172172
<os64>true</os64>
173173
<arch>maci64</arch>

atmat/Contents.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Accelerator Toolbox
2-
% Version 2.2-dev.377 (atcollab) 25-Feb-2022
2+
% Version 2.3 (atcollab) 01-Apr-2022
33
%
44
% atdiag - Tests AT intallation
55
% atdisplay - checks the verbosity level in the global variable GLOBVAL

atmat/at.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Accelerator Toolbox
2-
% Version 2.2-dev.377 (atcollab) 25-Feb-2022
2+
% Version 2.3 (atcollab) 01-Apr-2022
33
%
44
% The Accelerator Toolbox was originally created by Andrei Terebilo.
55
% Development is now continued by a multi-laboratory collaboration, <a href="matlab:web('https://github.com/atcollab')">atcollab</a>
@@ -140,4 +140,4 @@
140140
%
141141
% <a href="matlab:help symplectify">symplectify</a> - Makes a matrix more symplectic
142142
%
143-
%<a href="matlab:web('/Applications/MATLAB_R2021b.app/help/3ptoolbox/atacceleratortoolbox/doc/AT_page.html')">See documentation for AT</a>
143+
%<a href="matlab:web('/Applications/MATLAB_R2022a.app/help/3ptoolbox/atacceleratortoolbox/doc/AT_page.html')">See documentation for AT</a>

developer/matlab/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,13 @@ gen_toc();
4545
```
4646
- Generates _atroot_/developer/matlab/m/*.m files*
4747
- Publishes these files in _atroot_/../docs/matlab/*.html
48+
- Publishes _atroot_/developer/matlab/mlx/*.mlx in _atroot_/../docs/matlab/*.html
4849
- Generates the User's guide files for the help browser
4950

50-
#### Custom files
51-
All _atroot_/developer/matlab/mlx/*.mlx must be manually exported as html into _atroot_/../docs/matlab
51+
**Warning:**
52+
53+
.mlx files must be run with Matlab 2021a to get plots with the right size. Otherwise,
54+
at the end of the data of each plot, replace `style="height: auto;"` with `style="width: 560;"`
5255

5356
#### Search database
5457
```Matlab

developer/matlab/atrelease.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ function atrelease()
55
% Copyright 2016-2020 The MathWorks, Inc.
66

77
%% Set toolbox name
8+
v = ver(atroot);
89
shortname = 'atmat';
9-
tbxname = 'accelerator-toolbox';
10+
longname = v.Name;
1011

11-
%% Get release script directory: AT root directory
12-
cfdir = fullfile(fileparts( mfilename( 'fullpath')),'..','..');
12+
%% Get AT root directory
13+
rootdir = fullfile(atroot,'..');
1314

1415
%% Check MATLAB and related tools, e.g.:
1516
assert( ~verLessThan( 'MATLAB', '9.6' ), 'MATLAB R2019a or higher is required to use Toolbox Tools.' )
1617

1718
%% Check installation
1819
fprintf( 1, 'Checking installation...' );
19-
v = ver( shortname );
2020
switch numel( v )
2121
case 0
2222
fprintf( 1, ' failed.\n' );
@@ -37,7 +37,7 @@ function atrelease()
3737
gen_help()
3838
gen_toc();
3939
% Remove all mex-files
40-
atclearmex(fullfile(cfdir,'atmat'));
40+
atclearmex(atroot);
4141
fprintf( 1, ' Done.\n' );
4242
catch e
4343
fprintf( 1, ' failed.\n' );
@@ -46,7 +46,7 @@ function atrelease()
4646

4747
%Build doc search database
4848
try
49-
builddocsearchdb(fullfile(cfdir,'docs','matlab'));
49+
builddocsearchdb(fullfile(rootdir,'docs','matlab'));
5050
catch me
5151
warning( me.message )
5252
end
@@ -65,8 +65,8 @@ function atrelease()
6565
%% Package and rename.
6666
fprintf( 1, 'Packaging...' );
6767
try
68-
package_name = fullfile(cfdir,'matlab_releases',sprintf('%s.v%s.mltbx',tbxname,version));
69-
prj = fullfile( cfdir, 'ToolboxPackagingConfiguration.prj');
68+
package_name = fullfile(rootdir,'matlab_releases',sprintf('%s.v%s.mltbx',tbxname,version));
69+
prj = fullfile( rootdir, 'ToolboxPackagingConfiguration.prj');
7070
matlab.addons.toolbox.packageToolbox( prj);
7171
fprintf( 1, ' Done.\n' );
7272
catch e

developer/matlab/gen_toc.m

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
function gen_toc()
22
%GEN_TOC Build the HTML files used by the Matlab help browser
33

4-
[here,~, ~]=fileparts(mfilename('fullpath'));
4+
[devdir,~, ~]=fileparts(mfilename('fullpath'));
55
docdir = fullfile(atroot,'..','docs','matlab');
66
tocfile = fullfile(docdir,'helptoc.xml');
7-
[fid,fmess,fmid] = copyfile(fullfile(here,'helptoc.xml'),tocfile);
7+
[fid,fmess,fmid] = copyfile(fullfile(devdir,'helptoc.xml'),tocfile);
88
if fid <= 0
99
error(fmid,'%s: %s',tocfile,fmess);
1010
end
1111
fid=openmfile(tocfile,'at');
1212

13+
% User guide
1314
ugname=fullfile('m','ugsummary.m');
1415
hid=openmfile(ugname,'wt');
1516
fprintf(fid,' <tocitem target="ugsummary.html"\n');
1617
fprintf(fid,' image="HelpIcon.USER_GUIDE">AT User Guide\n');
1718
fprintf(hid,'%%%% AT User Guide\n%%\n%%%%\n');
19+
% Loop on UG chapters
1820
for m=atchapters()
1921
mname = fullfile('m', m.id+".m");
2022
fprintf(hid,'%% <matlab:web(fullfile(docroot,''3ptoolbox'',''atacceleratortoolbox'',''doc'',''%s.html'')) %s>\n%%\n',m.id,m.title);
@@ -28,27 +30,31 @@ function gen_toc()
2830
fprintf(fid,' </tocitem>\n');
2931
fclose(hid);
3032

31-
howtoname=fullfile('m','howtosummary.m');
32-
hid=openmfile(howtoname,'wt');
33-
fprintf(fid,' <tocitem target="howtosummary.html"\n');
34-
fprintf(fid,' image="HelpIcon.USER_GUIDE">How to…\n');
35-
fprintf(hid,'%%%% How to…\n%%\n%%%%\n');
36-
for m=howtochapters()
37-
fprintf(hid,'%% <matlab:web(fullfile(docroot,''3ptoolbox'',''atacceleratortoolbox'',''doc'',''%s.html'')) %s>\n%%\n',m.id,m.title);
38-
fprintf(fid,' <tocitem target="%s.html">%s</tocitem>\n',m.id,m.title);
39-
end
40-
fprintf(fid,' </tocitem>\n');
41-
fclose(hid);
33+
% How to...
34+
mlxloop('howtos','How to…',@howtochapters);
35+
36+
% Release notes
37+
mlxloop('release_notes','Release notes');
4238

39+
% Web site
4340
fprintf(fid,' <tocitem target="https://atcollab.github.io/at/" \n');
4441
fprintf(fid,' image="$toolbox/matlab/icons/webicon.gif">\n');
4542
fprintf(fid,' AT Web Site\n');
4643
fprintf(fid,' </tocitem>\n');
44+
4745
fprintf(fid,' </tocitem>\n');
4846
fprintf(fid,'</toc>\n');
4947
fclose(fid);
48+
5049
publish(ugname,'evalCode',false,'outputDir',docdir);
51-
publish(howtoname,'evalCode',false,'outputDir',docdir);
50+
51+
% Publish custom files
52+
for dd=reshape(dir(fullfile(devdir,'mlx')),1,[])
53+
[~,nn,xx]=fileparts(dd.name);
54+
if strcmp(xx,'.mlx')
55+
export(fullfile(dd.folder,dd.name),fullfile(docdir,strcat(nn,'.html')));
56+
end
57+
end
5258

5359
function mloop(fid,mlist)
5460
for item=mlist
@@ -68,6 +74,33 @@ function mloop(fid,mlist)
6874
end
6975
end
7076

77+
function mlxloop(secdir,secname,chapfun)
78+
if nargin<3, chapfun=@lst; end
79+
dirname=fullfile(devdir,secdir);
80+
sumname=fullfile(devdir,'m',[secdir '.m']);
81+
sumid=openmfile(sumname,'wt');
82+
fprintf(fid,' <tocitem target="%s" \n', [secdir '.html']);
83+
fprintf(fid,' image="$toolbox/matlab/icons/webicon.gif">\n');
84+
fprintf(fid,' %s\n',secname);
85+
fprintf(sumid,'%%%% %s\n%% \n%%%%\n', secname);
86+
for mm=chapfun()
87+
target=fullfile(secdir,mm.id+".html");
88+
export(fullfile(secdir,mm.id+".mlx"),fullfile(docdir,target));
89+
fprintf(sumid,'%% <matlab:web(fullfile(docroot,''3ptoolbox'',''atacceleratortoolbox'',''doc'',''%s'')) %s>\n%%\n',target,mm.title);
90+
fprintf(fid,' <tocitem target="%s">%s</tocitem>\n',target,mm.title);
91+
end
92+
fclose(sumid);
93+
publish(sumname,'evalCode',false,'outputDir',docdir);
94+
fprintf(fid,' </tocitem>\n');
95+
delete(sumname);
96+
function res=lst()
97+
vals=reshape(dir(fullfile(dirname,'*.mlx')),1,[]);
98+
[~,nms,~]=arrayfun(@fileparts,{vals.name},'UniformOutput',false);
99+
nms=string(sort(nms));
100+
res=struct('id',nms,'title',nms);
101+
end
102+
end
103+
71104
function fid=openmfile(fpath,mode)
72105
[fid,mess]=fopen(fpath,mode);
73106
if fid < 0
File renamed without changes.
-8.57 KB
Binary file not shown.
4.29 KB
Binary file not shown.

developer/matlab/setversion.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ function setversion(version)
33
%
44
%SERVERSION(VERSION)
55

6-
gitroot=fullfile(fileparts(mfilename('fullpath')),'..','..');
7-
versfile=fullfile(gitroot,'atmat','Contents.m');
6+
versfile=fullfile(atroot,'Contents.m');
87
tmpfile=fullfile(tempdir,'Contents.m');
98
fout=fopen(tmpfile,'wt');
109
fin=fopen(versfile,'rt');

0 commit comments

Comments
 (0)