bugGNU Octave - Bugs: bug #45833, support load/save of classdef...

 
 

bug #45833: support load/save of classdef objects

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Thu 27 Aug 2015 12:09:04 PM UTC  
 
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Fri 28 Aug 2015 11:06:01 AM UTC, comment #6:

Parallel execution with the 'parallel' package, functions 'parcellfun' (local) or e.g. 'netcellfun' (cluster), relies on the values of single variables being transfered with Octaves save/load methods (currently 'save_binary_data()' is called). It must be recognized if sending (with a save method) a value failed, otherwise the reading process will just hang.

Since there may exist types derived from octave_base_value which can't be saved (as e.g. types provided by some packages), it is not feasible for the 'parallel' package to keep track which types can be saved and which can't. So if you should change the error into a warning, could you please provide an option of these methods to request the previous behaviour, i.e. an error?

Olaf

Olaf Till <i7tiol>
Project Member
Thu 27 Aug 2015 09:37:58 PM UTC, comment #5:

That's probably a good thing to do so that any strange octave_value object, like a 'magic colon' or 'lazy index', won't cause the save process to abort.

It still might be worthwhile to override the base save_ascii, load_ascii, save_binary, load_binary in ov-classdef.cc because then you could tailor the warning message. Instead of

you could have something like that done for java objects

or for onCleanup objects

Rik <rik5>
Project Administrator
Thu 27 Aug 2015 08:52:48 PM UTC, comment #4:

Those functions already exist in the octave_base_value class. They currently call gripe_wrong_type_arg. That function already accepts an optional argument (default value = true) to say whether to issue an error or warning. So this behavior should be fairly trivial to change.

John W. Eaton <jwe>
Project Administrator
Thu 27 Aug 2015 08:35:31 PM UTC, comment #3:

@jwe: It definitely would be a good idea to have placeholder save functions that issue a warning, but allow any other variables to be saved. I did that for java objects recently in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/b22528fd3deb). An important issue is that when Octave is in the midst of crashing it attempts to save all variables to the octave-workspace file. If you happen to have a classdef object in the workspace then the saving of variables itself has an error and the entire workspace is lost.

Rik <rik5>
Project Administrator
Thu 27 Aug 2015 06:51:00 PM UTC, comment #2:

Also, would it make sense to change the error to just be a warning so that objects that could be saved are saved and the others are just skipped?

John W. Eaton <jwe>
Project Administrator
Thu 27 Aug 2015 06:17:13 PM UTC, comment #1:

In https://lists.gnu.org/archive/html/octave-maintainers/2014-08/msg00180.html, jwe mused whether adding support for classdef objects for all file formats might be a waste of time, and whether this would be a good time to deprecate some of the supported file formats, or only add support for new types to certain file formats, etc.

So load/save of classdef objects may or may not need to be implemented in all possible file formats, it may be worth further discussion.

Mike Miller <mtmiller>
Project Administrator
Thu 27 Aug 2015 12:09:04 PM UTC, original submission:

Classdef objects cannot currently be loaded or saved:

Mike Miller <mtmiller>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by i7tiol (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mtmiller (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-27 mtmiller Dependencies- => bugs #45831 is dependent

    Back to the top


    Powered by Savane 3.3