Git Product home page Git Product logo

bls-matlab's People

Contributors

micahjsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bls-matlab's Issues

Error "Dot indexing is not supported" from advanced queries

Note: I'm using Matlab R2019a on a server.

The first time I tried to use the package, I an error when running the following code (<<>> indicates that I had to redact the information):

d = '<<some_path>>\inputdata\';
path1 = genpath(d) ;
path(path1,path) ;

APIKey = '<<my api key>>' ;

b = bls([], APIKey);
data = fetch(b, 'PRS85006092', 'catalog', 'true');

The error I got was the following (note, it traces the error from the original Matlab test script, Untitled2.m):

Dot indexing is not supported for variables of this type.

Error in bls/fetch>blsExtractDataField (line 127)
value = str2double(field.value);

Error in bls/fetch (line 116)
data = arrayfun(@blsExtractDataField, ...

Error in Untitled2 (line 14)
data = fetch(b, 'PRS85006092', 'catalog', 'true');

It seems the error could be traced to the command (around line 116):

        data = arrayfun(@blsExtractDataField, ...
                    response.Results.series(iSeries).data, 'un', 0);

I was able to modify the "fetch" command with the following code replacing the above:

    try
        data = arrayfun(@blsExtractDataField, ...
                    response.Results.series(iSeries).data, 'un', 0);
    catch
        data = cellfun(@blsExtractDataField, ...
                    response.Results.series(iSeries).data, 'un', 0);
    end

This seems to have solved the issue, although I am not sure how.

does not run

I used your class file and the function. I created a main and typed
b = bls([], I put my API key here);
data = fetch(b, 'PRS85006092', 'catalog', 'true');

I got this message

File: main.m Line: 1 Column: 15
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax
error. To construct matrices, use brackets instead of parentheses.

Request failed with message 'The key:>key provided by the User is invalid. Please provide a proper key for the operation to be successful

Good day!

I have written a code around your 'fetch.m' function to retrieve data from the BLS API. The code worked fine until recently and now I am getting the following warning message:

"Request failed with message 'The key: provided by the User is invalid. Please provide a proper key for the operation to be successful."

'>key' is just a placeholder in this warning. In my code, I tried two different keys. The first was the BLS key that I always use and which worked until two days ago, and the second is newly created and runs into the exact same problem.
Below is a minimal, reproducible example that should retrieve the CPI data for all items.

blsKey = >key;
b = bls([], blsKey);
fetch(b,'CUUR0000SA0',2019,'catalog','true')

Again, '>key' must be replaced by a character array with a valid key. In my case, it encounters the above warning.
Any help will be greatly appreciated. Many thanks in advance!

Kind regards
Lauritz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.