-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleaning table
classdef methods
#115
Comments
Some thoughts so far: As context, my main priorities for Tablicious are compatibility with Matlab's interface, and that it work with Octave and other OF packages as they are now (including the last version or two of Octave, for folks who haven't upgraded yet), and not relying on changes in future versions. I'm happy to make changes for compatibility with future versions of Octave etc. when they happen.
table2array, table2cell, table2struct, and convertvars are already methods in
The
Added
I removed these functions, leaving only the
Most of the other methods are there for a reason, because they provide functionality that I needed or wanted. It's unfortunate that there are so many methods, especially all the "structural" stuff like shiftdims, but they make Like, without an override,
I think that's less helpful for a user new to Tablicious or Octave than something like this:
Though I think Are there particular methods you would like removed, or particular currently-public methods you would like made private? |
That's correct, I missed that.
If you add these as functions, then they will shadow Octave's core once they are implemented and this can happen before table class is pushed into core.
There is a difference in whether we want to update a classdef with intent to go into core in the near future or to fit our needs. If you are developing a classdef to meet certain needs, this is great but it will take much more effort to streamline it and test it for being MATLAB compatible before going into core. I am mostly interested in the latter, because once I start adding table support in statistics, I want to be as confident as possible that I have a fully MATLAB compatible classdef to work with so that any future regression are minimized in the future. I have worked extensively the past few days to fix compatiibility issues of your implementation with MATLAB, including |
Hmm. I'm wondering what making the methods private would do in terms of usability at this point. The funky private methods like
Don't know there's much I can do about that by tweaking the access modifiers on the methods. Maybe there's some way of customizing tab completion for a classdef in Octave to get them to not show up there? Overriding Looks like Maybe the most useful thing in terms of documentation would be to remove the Texinfo helptext items for those structural etc. method overrides, so they don't show up in the generated doco at all. (They're already absent from |
If they get implemented in core Octave, then I can make a new release of Tablicious which removes them. Or better yet, moves them into a
I agree, Matlab compatibility is a pretty high priority here. But in my view, the real measure of Matlab compatibility is in the public or externally visible behavior of As a solo project that's still in the 0.x release series, I think it's easier and quicker to make changes in the Tablicious package than in code that's in core Octave or well on its way there. And it seems like the modifications for then pulling
That's reasonable. Tablicious's primary goal is to be usable by end users with the current versions of Octave. To me, that means providing function definitions for table-related functions where needed so that users can write table-using code the same way they would with Matlab, including migrating Matlab code over directly. For example, I want users to be able to write like Supplying code for possible importing to core Octave is something I value too, but it's a secondary goal for me. Maybe I just don't understand Octave's OOP support well enough, but it seems like a separate clean implementation of Or maybe it's that I'm not familiar enough with Octave's builtin functions or their support for extension. Like, if I override |
Some of these are good candidates for moving around, though. There's a few internal-use things that could be made local or private functions, instead of private methods (which are still exposed in Have a look at the
And I removed the texinfo doco sections for some of the private or "structural" methods in That should clean up the |
Oh, the other thing is that the Table I/O stuff I'm writing could be done in a separate Tablicious-IO package, so users/clients could select that independently from Tablicious. E.g. a user could install, or another package could take a (optional) dependency on, Tablicious, but still keep the Table I/O functions and classes out of their namespace if they wanted. That seems like a good idea. |
As said previously, my intent is to have a MATLAB alike table class def as a reference to update all the functions in the statistics package. As you can understand, this needs to be a vanilla table, but fully functional in terms of identical behavior. This is what I am currently working on. I get that you are keen into introducing various bits and pieces in the tablicious package and you prefer handling the tablicious package as a solo project. That's fine, but it just doesn't work very well for me. In statistics package, whoever from the very few few developers, who are contributing from time to time, starts working on a bug fix, a new feature or a function, I just make the assignment and wait for a PR within a reasonable time window, since we are all volunteers and everyone contributes at their own time. Of course, this does not mean that other package maintainers should follow my rule of thumb. But the same applies to me as a contributor. Since I've started adding BISTs in the classdef, I have made numerous bug fixes and feature updates in order to keep the functionality consistent with MATLAB (at least to the extent of my testing suite). Merging back these changes will disrupt some of the functionality you already have in the Tablicious package. So I think it is best for now to keep them separately and just use my version for the statistics package, since it already relies on its functionality for the |
I moved the table Moved the That should clear up some more collisions, and get the |
Fair enough. Coordinating development between projects does add overhead. Closing this out. |
Since the
table
classdef has numerous methods, many of which are kind of unnecessary, I suggest that a good start is the MATLAB documentation itself as a guide of what we could/should keep in the Tablicious package as a function, what should be a table class method, and what we could/should remove.According to this I summarize bellow
Functions
table
,array2table
,cell2table
,struct2table
,table2array
,table2cell
,table2struct
,table2timetable
,vartype
,convertvars
.I suggest that
array2table
,cell2table
,struct2table
remain as functions, andtable2array
,table2cell
,table2struct
,table2timetable
,vartype
,convertvars
should be methods intable
classdef.table2timetable
should be there as a method and do nothing (perhaps return an error) until timetables are also supported.Read and Write Files
readtable
,writetable
,detectImportOptions
,spreadsheetImportOptions
,getvaropts
,setvaropts
,setvartype
,preview
,parquetread
,parquetwrite
,parquetinfo
.I suggest that we let all these to be handled by the
io
package. Of course, we could work on these, but push patches to theio
package instead of implementing these inside the Tablicious package.Summary Information and Stacked Plot
summary
,height
,width
,istable
,istabular
,head
,tail
,stackedplot
.I suggest that
istable
andistabular
remain as functions (istabular
is missing but we can implement it) andsummary
,height
,width
,head
,tail
,stackedplot
should be methods intable
classdef.Sort, Filter, and Rearrange
sortrows
,unique
,issortedrows
,topkrows
,rowfilter
,addvars
,renamevars
,movevars
,removevars
,splitvars
,mergevars
,convertvars
,rows2vars
,stack
,unstack
,innerouter
,addprop
,rmprop
.I suggest that
sortrows
,unique
,issortedrows,
topkrows' should be methods untiltable
class gets merged into Octave core (by that time their functionality could be complemented by the respective core functions and removed).rowfilter
should be left for theio
package as the rest Read and Write Files functions. The remainingaddvars
,renamevars
,movevars
,removevars
,splitvars
,mergevars
,convertvars
,rows2vars
,stack
,unstack
,innerouter
,addprop
,rmprop
should be methods in thetable
classdef.Join and Set Operations
join
,innerjoin
,outerjoin
,union
,instersect
,ismember
,setdiff
,setxor
.These all should be implemented as methods in the
table
classdef (some of them are already).Missing Values
anymissing
,ismissing
,standardizeMissing
,fillmissing
.These can be handled in the
statistics package
for the time being, and by the timetable
class is merged into core Octave, they can also be merged back to core.Apply Functions to Table Contents
pivot
,groupcounts
,groupfilter
,groupsummary
,grouptransform
,findgroups
,splitapply
,rowfun
,varfun
.These should be included as methods in the
table
classdef.My suggestion is that all other methods presently available in the table class should be removed and those that are necessary for internal computations for the class to work properly should be made explicitly private.
Andrew's notes
Related tickets:
The text was updated successfully, but these errors were encountered: