Giter Club home page Giter Club logo

deck's People

Contributors

jhadida avatar sheljohn avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

deck's Issues

Store mapred templates

It might be better to move the folder of templates to the install location along with the Python scripts.
This would allow the user to define their own templates in a more sensible place than +dk/+mapred/templates.

Not sure about this. But if going through with it, we need to keep track of where the stuff is installed in order to initialise painlessly, so maybe a .bindir file created and ignored in the mapred folder.

Spaces in compiler paths

Check if there is an issue with spaces in the paths provided to obj.Compiler. If so, find the correct way to escape them (ie either quote or escape spaces themselves).

Change behaviour of mapfun

Let mapfun behave as arrayfun on all non-cell inputs, including scalar structs.
Bring dk.struct.kvfun to first level in order to get a map function on struct or struct-arrays.

Use logger for messaging

  • Remove +verb/ submodule, in favour of using the dk.logger.Logger implementation.
  • Default logger should be created at startup.
  • Additional function dk.logger.level to simplify level control.
  • Alias method Logger:setFile, more explicit than open.
  • Implement static class dk.logger.test to be called by assert/reject in order to redirect assertions to different channels.
  • Remove static method callerInfo from Logger, and move it to separate dk.logger.chan instead (taking stack depth argument), which returns a struct with channel ID and caller string.
  • Update Logger:write to take a channel as first input, and exclude empty caller from log line.
  • Implement function dk.log, taking a channel as first input (or creating a default one if formatted message is passed directly), with a persistent instance of the default logger.
funciton log(varargin)
    persistent..

    args = varargin;
    if nargin  > 1
        v = args{1};
        if isstruct(v)
            chan = v;
            args = varargin(2:end);
        elseif ismember(v,{'w','e','...'})
            chan = dk.logger.chan( v, 4 );
            args = varargin(2:end);
        else
            chan = dk.logger.chan( 'i', 4 );
        end
    end
    L.write( chan, args{:} );
end
  • Refactor functions dk.warn/info to call dk.log
  • Remove ..if methods from Logger, in favour of directed assertions.
  • Replace calls to dk.wassert/wreject with calls to assert with specified channels.

License?

Is this code available under an open source license? I'm in the market for a new JSON parser...

Error when trying to encode a structure containing a 2D cell

I've found the following causes an error:

test = struct('value', {{1 2; 3 4}});
g = dk.json.encode(test);
Error using dk.json.encode>write_struct (line 46)
Assertion failed.
Error in dk.json.encode>write_array (line 100)
    s = write_struct(x,w,w.shapepfx);
Error in dk.json.encode>write_value (line 16)
            s=write_array(x,w,t);
Error in dk.json.encode>write_struct (line 57)
        s{i} = [w.ind w.enc.char([p f]) ':' w.sp write_value(x.(f),w)];
Error in dk.json.encode>write_scalar (line 128)
            s=write_struct(x,w);
Error in dk.json.encode>write_value (line 29)
            s=write_scalar(x,w,t);
Error in dk.json.encode (line 4)
    txt = write_value(dat,fmt); 

No issues with column or row cell arrays.

test = struct('value', {{1 2}});
g = dk.json.encode(test);
test = struct('value', {{1; 2}});
g = dk.json.encode(test);

Edit:
The issue is coming from

x = struct( 'size', dim, 'stride', str, 'value', reshape(x,1,numel(x)) );

In MATLAB struct('value', {1 2 3 4}) will create an array of structures (1x4 in this case). To get a structure containing a cell array you would need to double up the {}, so struct('value', {{1 2 3 4}}).
A possible solution could be:

    if strcmp(name, 'cell')
        x = struct( 'size', dim, 'stride', str, 'value', {reshape(x,1,numel(x))} );
    else
        x = struct( 'size', dim, 'stride', str, 'value', reshape(x,1,numel(x)) );
    end

ksdensity arguments

Description

From Matlab version 2016a, the named argument npoints has changed to NumPoints without backwards compatibility.

To-do

Create a backwards-compatible function in dk.math and replace all occurences throughout the package.

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.