Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mdbnomics
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Massimo Giovannini
mdbnomics
Commits
8fe81617
Commit
8fe81617
authored
2 years ago
by
MichelJuillard
Browse files
Options
Downloads
Patches
Plain Diff
fix compatibility with Octave v7.2
parent
5a8da364
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/initialize_mdbnomics.m
+9
-7
9 additions, 7 deletions
src/initialize_mdbnomics.m
src/utils/fetch_series_page.m
+8
-8
8 additions, 8 deletions
src/utils/fetch_series_page.m
with
17 additions
and
15 deletions
src/initialize_mdbnomics.m
+
9
−
7
View file @
8fe81617
...
...
@@ -50,14 +50,16 @@ end
P
=
cellfun
(
@
(
c
)[
mdbnomics_src_root
c
],
p
,
'uni'
,
false
);
addpath
(
P
{:});
% Check minimal MATLAB requirements.
if
matlab_ver_less_than
(
'8.5'
)
error
(
'The minimum MATLAB requirement of this package is R2015a.'
);
end
if
~
isoctave
()
% Check minimal MATLAB requirements.
if
matlab_ver_less_than
(
'8.5'
)
error
(
'The minimum MATLAB requirement of this package is R2015a.'
);
end
% Add jsonlab if MATLAB version < R2016b
if
matlab_ver_less_than
(
'9.1'
)
addpath
([
mdbnomics_src_root
'/../contrib/jsonlab'
]);
% Add jsonlab if MATLAB version < R2016b
if
matlab_ver_less_than
(
'9.1'
)
addpath
([
mdbnomics_src_root
'/../contrib/jsonlab'
]);
end
end
mdb_options
.
api_base_url
=
'https://api.db.nomics.world'
;
...
...
This diff is collapsed.
Click to expand it.
src/utils/fetch_series_page.m
+
8
−
8
View file @
8fe81617
...
...
@@ -30,7 +30,7 @@ function response_json = fetch_series_page(series_endpoint_url, offset)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if
conta
in
s
(
series_endpoint_url
,
'?'
)
if
strf
in
d
(
series_endpoint_url
,
'?'
)
series_page_url
=
sprintf
(
'%s%soffset=%i'
,
series_endpoint_url
,
'&'
,
offset
);
else
series_page_url
=
sprintf
(
'%s%soffset=%i'
,
series_endpoint_url
,
'?'
,
offset
);
...
...
@@ -38,18 +38,18 @@ end
options
=
weboptions
(
'ContentType'
,
'json'
);
try
response_json
=
webread
(
series_page_url
,
options
);
if
isoctave
()
disp
(
webread
(
series_page_url
,
options
))
response_json
=
jsondecode
(
webread
(
series_page_url
,
options
));
else
response_json
=
webread
(
series_page_url
,
options
);
end
catch
ME
error_message
=
[
'Could not fetch data from URL: '
series_page_url
' because: '
ME
.
identifier
];
error
(
error_message
);
end
if
isempty
(
response_json
.
errors
)
series_page
=
response_json
.
series
;
if
~
isempty
(
series_page
)
assert
(
series_page
.
offset
==
offset
);
end
else
if
~
isempty
(
response_json
.
errors
)
error_
=
response_json
.
errors
;
if
~
isempty
(
error_
.
dataset_code
)
&&
isempty
(
error_
.
series_code
)
error
(
'%s for: %s. Please revise your input for dataset code.'
,
error_
.
message
,
error_
.
dataset_code
);
...
...
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