-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added converter to convert SpinW MarkDown style to unicode text that can be displayed in the Command Window - converted all calls to ‘help’ —> ‘swhelp’
- Loading branch information
Showing
108 changed files
with
537 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
% SpinW | ||
% Version 3.0 6-Feb-2017 | ||
% Version 4.0 (unreleased) 29-Nov-2017 | ||
% | ||
|
||
% TODO fix this file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ | |
|
||
% help when executed without argument | ||
if nargin==1 | ||
help spinw.core | ||
swhelp spinw.core | ||
return | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
% | ||
|
||
if nargin == 0 | ||
help sw_intsf | ||
swhelp sw_intsf | ||
return | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
% | ||
|
||
if nargin == 0 | ||
help sw_phonopy | ||
swhelp sw_phonopy | ||
return | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
% | ||
|
||
if nargin == 0 | ||
help sw_plotsf | ||
swhelp sw_plotsf | ||
return | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,62 +14,33 @@ function sw_release(verNum, tempDir) | |
% | ||
|
||
if nargin == 0 | ||
help sw_release | ||
swhelp sw_release | ||
return | ||
end | ||
|
||
% create search database for the help | ||
%builddocsearchdb([sw_rootdir 'help' filesep 'html']); | ||
%builddocsearchdb([sw_rootdir 'html']); | ||
|
||
% get version information for the release | ||
swVer = sw_version; | ||
|
||
if ~isempty(swVer.Version) | ||
disp('The current version of SpinW is already released!'); | ||
return | ||
end | ||
|
||
% get latest revision number | ||
aDir = pwd; | ||
cd(sw_rootdir); | ||
|
||
%[statSys, revNum] = system('svn info |grep Revision: |cut -c11-'); | ||
|
||
% svn revision number | ||
%[statSys, revNum] = system('svn up --trust-server-cert --non-interactive'); | ||
% Git "revision" number | ||
[statSys, revNum] = system('git rev-list --count HEAD'); | ||
|
||
revNum = strtrim(revNum); | ||
|
||
%strIdx = strfind(revNum,' '); | ||
%revNum = revNum(strIdx(end):(end-1)); | ||
|
||
if ~statSys | ||
|
||
revNum = str2double(revNum); | ||
else | ||
revNum = 1; | ||
end | ||
|
||
% add 1000 to the revision number due to the switch to git from svn | ||
% and keep the monotonity of revision numbers | ||
revNum = revNum + 1000; | ||
|
||
cd(aDir); | ||
|
||
if isnumeric(verNum) | ||
verNum = num2str(verNum); | ||
end | ||
|
||
% includes the following comments to every .m file | ||
newLine = sprintf('\n'); | ||
revText{1} = ['% $Name: SpinW$ ($Version: ' verNum '$)' newLine]; | ||
revText{2} = ['% $Author: S. Toth$ ($Contact: [email protected]$)' newLine]; | ||
revText{3} = ['% $Revision: ' num2str(revNum) ' $ ($Date: ' date ' $)' newLine]; | ||
revText{4} = ['% $License: GNU GENERAL PUBLIC LICENSE$' newLine]; | ||
newLine = char(10); %#ok<CHARTEN> | ||
revText{1} = ['% $Name: ' swVer.Name '$ ($Version: ' verNum '$)' newLine]; | ||
revText{2} = ['% $Author: ' swVer.Author '$ ($Contact: ' swVer.Contact '$)' newLine]; | ||
revText{3} = ['% $Revision: ' swVer.Release '$ ($Date: ' date '$)' newLine]; | ||
revText{4} = ['% $License: ' swVer.License '$' newLine]; | ||
revText{5} = newLine; | ||
|
||
% current directory | ||
aDir = pwd; | ||
|
||
% use current directory where the temp directory is created in case no | ||
% tempDir defined | ||
if nargin == 1 | ||
|
@@ -94,7 +65,7 @@ function sw_release(verNum, tempDir) | |
verNum2 = verNum; | ||
verNum2(verNum2=='.') = '-'; | ||
|
||
swDirName = ['spinw' verNum2(1) '_R' num2str(revNum)]; | ||
swDirName = ['spinw' verNum2(1) '_R' num2str(swVer.Release)]; | ||
|
||
mkdir([tempDirName filesep swDirName]); | ||
tempDirName0 = tempDirName; | ||
|
@@ -128,7 +99,7 @@ function sw_release(verNum, tempDir) | |
end | ||
end | ||
|
||
% add revision number | ||
% add release number | ||
mLines(end+(1:numel(revText))) = revText; | ||
|
||
% add remaining lines | ||
|
@@ -148,7 +119,7 @@ function sw_release(verNum, tempDir) | |
|
||
% change the Contents file | ||
cId = fopen([tempDirName filesep 'Contents.m'],'w'); | ||
fprintf(cId,['%% SpinW\n%% Version ' verNum ' (R' num2str(revNum) ') ' swVer.Date '\n%%']); | ||
fprintf(cId,['%% SpinW\n%% Version ' verNum ' (R' num2str(swVer.Release) ') ' swVer.Date '\n%%']); | ||
fclose(cId); | ||
|
||
cd(tempDirName0); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
function x = iindex(x,varargin) | ||
% inline indexing using parenthesis or braces | ||
|
||
switch varargin{1} | ||
case '()' | ||
x = x(varargin{2:end}); | ||
case '{}' | ||
x = x{varargin{2:end}}; | ||
otherwise | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Copyright (c) 2009, Gus Brown | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* 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 | ||
|
||
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 OWNER 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. |
Oops, something went wrong.