Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
reporting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Archives
reporting
Commits
29d19e4c
Project 'Dynare/reporting' was moved to 'Archives/reporting'. Please update any links and bookmarks that may still have the old path.
Verified
Commit
29d19e4c
authored
Oct 24, 2019
by
Houtan Bastani
Browse files
Options
Downloads
Patches
Plain Diff
only allow addData to be used once per table
parent
ef345742
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/@report_data/report_data.m
+0
-1
0 additions, 1 deletion
src/@report_data/report_data.m
src/@report_data/writeDataForTable.m
+3
-20
3 additions, 20 deletions
src/@report_data/writeDataForTable.m
src/@report_table/addData.m
+4
-1
4 additions, 1 deletion
src/@report_table/addData.m
with
7 additions
and
22 deletions
src/@report_data/report_data.m
+
0
−
1
View file @
29d19e4c
...
...
@@ -19,7 +19,6 @@ classdef report_data < handle
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
properties
(
SetAccess
=
private
)
data
=
''
tableSubSectionHeader
=
''
tableAlignRight
=
false
tableRowColor
=
'white'
tableRowIndent
=
0
...
...
This diff is collapsed.
Click to expand it.
src/@report_data/writeDataForTable.m
+
3
−
20
View file @
29d19e4c
...
...
@@ -32,12 +32,6 @@ function writeDataForTable(o, fid, precision)
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
%% Validate options provided by user
assert
(
ischar
(
o
.
tableSubSectionHeader
),
'@report_data.writeDataForTable: tableSubSectionHeader must be a string'
);
if
isempty
(
o
.
tableSubSectionHeader
)
assert
(
~
isempty
(
o
.
data
)
&&
iscell
(
o
.
data
),
...
'@report_data.writeDataForTable: must provide data as a cell'
);
end
assert
(
ischar
(
o
.
tableRowColor
),
'@report_data.writeDataForTable: tableRowColor must be a string'
);
assert
(
isint
(
o
.
tableRowIndent
)
&&
o
.
tableRowIndent
>=
0
,
...
'@report_data.writeDataForTable: tableRowIndent must be an integer >= 0'
);
...
...
@@ -53,20 +47,9 @@ rounding = 10^precision;
%% Write Output
fprintf
(
fid
,
'%% Table Data (report_data)\n'
);
nrows
=
length
(
o
.
data
{
1
});
ncols
=
length
(
o
.
data
);
[
nrows
,
ncols
]
=
size
(
o
.
data
);
for
i
=
1
:
nrows
if
~
isempty
(
o
.
tableRowColor
)
&&
~
strcmpi
(
o
.
tableRowColor
,
'white'
)
fprintf
(
fid
,
'\\rowcolor{%s}'
,
o
.
tableRowColor
);
else
fprintf
(
fid
,
'\\rowcolor{%s}'
,
o
.
tableRowColor
);
end
if
~
isempty
(
o
.
tableSubSectionHeader
)
fprintf
(
fid
,
'\\textbf{%s}'
,
o
.
tableSubSectionHeader
);
fprintf
(
fid
,
'%s'
,
repmat
(
' &'
,
1
,
ncols
-
1
));
fprintf
(
fid
,
'\\\\%%\n'
);
return
end
if
o
.
tableAlignRight
fprintf
(
fid
,
'\\multicolumn{1}{r}{'
);
end
...
...
@@ -81,7 +64,7 @@ for i = 1:nrows
fprintf
(
fid
,
'}'
);
end
for
j
=
1
:
ncols
val
=
o
.
data
{
j
}
(
i
);
val
=
o
.
data
(
i
,
j
);
if
iscell
(
val
)
val
=
val
{:};
end
...
...
This diff is collapsed.
Click to expand it.
src/@report_table/addData.m
+
4
−
1
View file @
29d19e4c
...
...
@@ -29,5 +29,8 @@ function o = addData(o, varargin)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
o
.
table_data
{
end
+
1
}
=
report_data
(
varargin
{:});
if
length
(
o
.
table_data
)
>=
1
error
(
'@report_table.addData: You can only use addData once per table'
)
end
o
.
table_data
{
1
}
=
report_data
(
varargin
{:});
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment