bugGNU Octave - Bugs: bug #56373, [octave forge] (io) xlswrite with...

 
 

bug #56373: [octave forge] (io) xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Wed 22 May 2019 06:29:09 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  philipnienhuis
Originator Name:  Nicholas Jankowski Open/Closed:  * Closed
Release:  * 5.1.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 08 Jun 2019 08:51:30 PM UTC, comment #6: 

AFAICS this bug was automagically fixed in Octave releases > 5.1.0.

In the fix for bug #56375 I included tests for writing NA and NaN values (that shouldn't be written but skipped) for all spreadsheet I/O interfaces.

Closing report.

Philip Nienhuis <philipnienhuis>
Group Member
Tue 04 Jun 2019 09:37:09 PM UTC, comment #5: 

Although the existing io package code "works for me" with Octave-6.0.0 I will extend the test scripts to also include NA / NaN behavior.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 22 May 2019 08:04:15 PM UTC, comment #4: 

@Mike: our posts crossed, I unintendedly reset the title change

Philip Nienhuis <philipnienhuis>
Group Member
Wed 22 May 2019 07:47:01 PM UTC, comment #3: 

bug #56375 created for ODS issue

Nicholas Jankowski <nrjank>
Group Member
Wed 22 May 2019 07:34:55 PM UTC, comment #2: 

for ODS I followed the same procedure as with the xlsx, ran once with both packages, then closed/reopened, and ran with just io.  zeros output consistent for both.  checking again:


>> pkg load io
>> chk_spreadsheet_support ()
ans = 0
>> a = NA(5)
a =

    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA

>> odswrite('testNA.ods',a)
Detected ODS interfaces: OCT*; (* = default interface)
ans =  1

output file has all zeros.

close/restart, then:

>> pkg load io
>> pkg load windows
>> chk_spreadsheet_support ()
ans =  1
>> a = NA(5)
a =

    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA

>> odswrite('testNA.ods',a)
Detected ODS interfaces: OCT*; (* = default interface)
ans =  1


again, output file has all zeros.  same behavior with NaN.

separate bug report?

Nicholas Jankowski <nrjank>
Group Member
Wed 22 May 2019 07:21:45 PM UTC, comment #1: 

The NA/NaN issues have been confirmed for a particular combination of Octave-5.1.0, windows pkg and io pkg (both loaded) as included in binary installer.
As Nicholas mentioned, I can't reproduce it with later octave crossbuilds.
In my local repo I have added NaN/NA behavior in the test scripts. It never occurred to me that these might give these problems. I'll push later hen I have more time.

Status: to be determined.

As to the .ods issue, I'll investigate later as well. I suppose this deserves a separate bug report.
@Nicholas:
Any idea which "interface" you were using when you find the ods error?
Perhaps just issue the command:
chk_spreadsheet_support ()
and report the output.

Philip Nienhuis <philipnienhuis>
Group Member
Wed 22 May 2019 06:29:09 PM UTC, original submission:  

From a help list conversation [1] it was determined that under certain conditions the xlswrite function would produce different outputs for NA valued array elements than in previous versions.

Expected (and Matlab compatible) output is for NA elements to produce blank cells in an XLSX file. 

With both io and windows packages loaded on a PC that has MS Office, tests with 4.4.1 show compatible behavior. In 5.1.0, the cells are instead filled with 65535:


>> pkg load io
>> pkg load windows
>> a = NA(5)
a =

    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA
    NA    NA    NA    NA    NA

>> xlswrite('testNA.xlsx',a)
Detected XLS interfaces: COM*; (* = default interface)
ans =  1

testNA.xlsx file shows:

65535        65535        65535        65535        65535
65535        65535        65535        65535        65535
65535        65535        65535        65535        65535
65535        65535        65535        65535        65535
65535        65535        65535        65535        65535


Closing Octave and repeating without loading the windows package, the cells are blank as expected. The same happens for cells containing NaN. 

mailing list comments indicate testing with 5.1.1 and 6.0.0 builds cannot recreate the problem.

Also, possibly a separate issue, or just a nonissue, odswrite produces zeros instead of blank cells for both NA and NAN whether or not the windows package is loaded.
 






[1] http://octave.1599824.n4.nabble.com/Nan-and-write-on-excel-65535-tp4692834p4692900.html

Nicholas Jankowski <nrjank>
Group Member

 

(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

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Updated the item)
  • -email is unavailable- added by nrjank (Submitted the item)
  • -email is unavailable- added by nrjank
  • -email is unavailable- added by nrjank
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-04-28 siko1056 Summary[octave-forge] (io) xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only [octave forge] (io) xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only
    2019-06-08 philipnienhuis StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2019-06-04 philipnienhuis StatusNone In Progress
        Assigned toNone philipnienhuis
    2019-05-22 philipnienhuis Summaryxlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only [octave-forge] (io) xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only
    2019-05-22 philipnienhuis Summary[octave forge] (io) xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only
    2019-05-22 mtmiller Summaryxlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only [octave forge] (io) xlswrite with windows pkg loaded produces erroneous NA output, v5.1.0 only
    2019-05-22 nrjank Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code