JimHokanson / matlab_standard_library

Standard Library for my Matlab Projects
MIT License
8 stars 10 forks source link

Add on an edit link for sl.obj.display_class #13

Closed JimHokanson closed 7 years ago

JimHokanson commented 9 years ago

sl.obj.display_class is meant to provide a nice visualization of both properties and methods in a class. The link in the methods provides help on the methods.

Add a link on the colon such that it opens the editor to that method.

Additionally, add a link on the colon for the properties to go to their definition in the editor.

JimHokanson commented 9 years ago

@DanielHull Please work on this now.

Once the edit link is added, please add on a link for a function prototype, and also include an indicator if the method is static.

perhaps it might look like:

.: or .: (s) when static

so with the method you might see: getData.: Retrieves a data object for a particular channel

. could be a link for the function prototype : could be a link to edit that method

Also, this function is really slow, please make it faster! Learn to use the profiler

Finally, or firstly, create a webpage that documents this project and your progress.

Please update this issue as you make progress. Please ask any questions on this issues page as well.

Best of luck, Jim

JimHokanson commented 9 years ago

Function prototype notes:

DanielHull commented 9 years ago

Hey Jim, I created my github.io: here you go. Use this to monitor me all the time in addition to looking at my github repositories... Ill update the io frequently. cool to have my own webpage. link: http://danielhull.github.io/grill_code_library_danielhull/

Also, I feel like I have a grasp of how to structure what you want here. I was thinking switch case if then structures. What I'm missing though is creating user functionality with links that can be displayed. I have this repository saved under DanielHull grill_code_library_danielhull for now. I'll move it over when it is more flushed out.

I was wondering if you could maybe describe a little more how to link in matlab. I looked online on several sites including mathworks and ran dry. I'll look again later and be back in tomorrow morning.

Thanks, Daniel

On Mon, Sep 22, 2014 at 9:55 AM, Jim Hokanson notifications@github.com wrote:

@DanielHull https://github.com/DanielHull Please work on this now.

Once the edit link is added, please add on a link for a function prototype, and also include an indicator if the method is static.

perhaps it might look like:

.: or .: (s) when static

so with the method you might see: getData.: Retrieves a data object for a particular channel

. could be a link for the function prototype : could be a link to edit that method

  • a function prototype is basically how one would normally call the function - in order to do this we'll get the line where the function is defined

Also, this function is really slow, please make it faster! Learn to use the profiler

Finally, or firstly, create a webpage that documents this project and your progress.

Please update this issue as you make progress. Please ask any questions on this issues page as well.

Best of luck, Jim

— Reply to this email directly or view it on GitHub https://github.com/JimHokanson/matlab_standard_library/issues/13#issuecomment-56376053 .

JimHokanson commented 9 years ago

@DanielHull

Please place your code in: sl.obj.dispObject_v1

You would find this by looking at the disp() method of sl.obj.display_class

When an object is displayed, it calls the objects disp() method if one is present. If all of this is confusing feel free to discuss this with me in person.

If you are worried about messing up the code you can always create a branch and work on the branch and the merge the branch into the main code at a later point. Alternatively, make sure all of your code is committed and then switch to your own fork of my repo, then do a pull request when you are done.

In the dispObject_v1 method you'll find all of the information you need in order to implement the edit links (well, in that method and other methods called, also you need to know that to edit you a file you would type 'edit ' such as edit sci.time_series.data OR alternatively edit('sci.time_series.data'))

The github.io site is looking like a nice start.

Jim

JimHokanson commented 9 years ago

@DanielHull

Comments were made on the committed code. Please make the fixes, remove the comments, and commit.

Thanks, Jim

DanielHull commented 9 years ago

Great you should have something from me by tomorrow night. Finishing up an ECE Problem set right after school and have an exam tomorrow. Will be at the meeting tomorrow morning.

Thanks, Daniel

On Sep 25, 2014, at 10:01 PM, Jim Hokanson notifications@github.com wrote:

@DanielHull

Comments were made on the committed code. Please make the fixes, remove the comments, and commit.

Thanks, Jim

— Reply to this email directly or view it on GitHub.

JimHokanson commented 9 years ago

I was thinking mlint was going to be needed to do the function prototype but it turns out using meta will be better. For now we'll skip trying to extract any definitions from the text.

See: http://www.mathworks.com/help/matlab/ref/meta.class.html

You will need the following lines, although I would change the variable names and also don't use ismember %# introspection (deal with cases of nested/sub-function) m = meta.class.fromName(fname); idx = find(ismember({m.MethodList.Name},functionFile)); inputNames = m.MethodList(idx).InputNames; outputNames = m.MethodList(idx).OutputNames;

You'll then need to figure out how to create the function prototype from knowing: 1) the input names 2) the output names 3) the function name 4) If it is static or not, and if so, what the full name of the class is

i.e. if you have a static method getData in the class +p1/+p2/@my_class

The display should be: [out1,out2] = p1.p2.my_class.getData(in1,in2)

Where I just made up in1 and in2

Best of luck. Come find me if you have questions

Also, you might want to check out: sl.cellstr.join For combining the input variables and the output variables

Jim

JimHokanson commented 9 years ago

@DanielHull

One other thing to do is to modify the link that displays the class name.

Modifications: 1) Display the full name of the class 2) Add on an explicit link to open the class in the editor

Jim