Re: bug in linkaxes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

Rik-4
On 04/27/2018 07:33 AM, [hidden email] wrote:
Subject:
bug in linkaxes ?
From:
avlas [hidden email]
Date:
04/27/2018 07:23 AM
To:
octave-maintainers [hidden email]
List-Post:
[hidden email]
Content-Transfer-Encoding:
7Bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
<4081026.BqDeKUviz3@kerna>
Content-Type:
text/plain; charset="us-ascii"
Message:
4

I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).

Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!

	% these examples work fine
	% for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
	% for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
	
	% these examples do NOT work
	for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
	% for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
	
	linkaxes(ha, 'x')

This is the error I'm finding:

	error: horizontal dimensions mismatch (1x1 vs 2x1)
	error: called from
	    linkprop at line 84 column 7
	    linkaxes at line 83 column 13

...
a.
This was a simple error in using a comma, ',', for horizontal concatenation when a semicolon, ';', was desired for vertical concatenation.  I fixed it on the stable branch here http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

avlas-2
El divendres, 27 d’abril de 2018, a les 12:59:30 EDT, Rik va escriure:

  On 04/27/2018 07:33 AM, [hidden email] wrote:
  > Subject:
  > bug in linkaxes ?
  > From:
  > avlas <[hidden email]>
  > Date:
  > 04/27/2018 07:23 AM
  >
  > To:
  > octave-maintainers <[hidden email]>
  >
  > List-Post:
  > <mailto:[hidden email]>
  > Content-Transfer-Encoding:
  > 7Bit
  > Precedence:
  > list
  > MIME-Version:
  > 1.0
  > Message-ID:
  > <4081026.BqDeKUviz3@kerna>
  > Content-Type:
  > text/plain; charset="us-ascii"
  > Message:
  > 4
  >
  >
  > I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).
  >
  > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
  >
  > % these examples work fine
  > % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  > % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >
  > % these examples do NOT work
  > for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  > % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >
  > linkaxes(ha, 'x')
  >
  > This is the error I'm finding:
  >
  > error: horizontal dimensions mismatch (1x1 vs 2x1)
  > error: called from
  >    linkprop at line 84 column 7
  >    linkaxes at line 83 column 13
  >
  > ...
  > a.
  This was a simple error in using a comma, ',', for horizontal concatenation
  when a semicolon, ';', was desired for vertical concatenation.  I fixed it
  on the stable branch here
  http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.
 
  --Rik
 
Thank you
....
a.



Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

avlas-2
El divendres, 27 d’abril de 2018, a les 13:10:51 EDT, avlas va escriure:

  El divendres, 27 d’abril de 2018, a les 12:59:30 EDT, Rik va escriure:
 
    On 04/27/2018 07:33 AM, [hidden email] wrote:
    > Subject:
    > bug in linkaxes ?
    > From:
    > avlas <[hidden email]>
    > Date:
    > 04/27/2018 07:23 AM
    >
    > To:
    > octave-maintainers <[hidden email]>
    >
    > List-Post:
    > <mailto:[hidden email]>
    > Content-Transfer-Encoding:
    > 7Bit
    > Precedence:
    > list
    > MIME-Version:
    > 1.0
    > Message-ID:
    > <4081026.BqDeKUviz3@kerna>
    > Content-Type:
    > text/plain; charset="us-ascii"
    > Message:
    > 4
    >
    >
    > I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).
    >
    > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
    >
    > % these examples work fine
    > % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
    > % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
    >
    > % these examples do NOT work
    > for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
    > % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
    >
    > linkaxes(ha, 'x')
    >
    > This is the error I'm finding:
    >
    > error: horizontal dimensions mismatch (1x1 vs 2x1)
    > error: called from
    >    linkprop at line 84 column 7
    >    linkaxes at line 83 column 13
    >
    > ...
    > a.
    This was a simple error in using a comma, ',', for horizontal concatenation
    when a semicolon, ';', was desired for vertical concatenation.  I fixed it
    on the stable branch here
    http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.
   
    --Rik
   
  Thank you
  ....
  a.
 
Unfortunately the commit didn't fix the issue. Could you please try to reproduce?
....
a.



Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

Rik-4
On 04/27/2018 10:25 AM, avlas wrote:

> El divendres, 27 d’abril de 2018, a les 13:10:51 EDT, avlas va escriure:
>
>   El divendres, 27 d’abril de 2018, a les 12:59:30 EDT, Rik va escriure:
>  
>     On 04/27/2018 07:33 AM, [hidden email] wrote:
>     > Subject:
>     > bug in linkaxes ?
>     > From:
>     > avlas <[hidden email]>
>     > Date:
>     > 04/27/2018 07:23 AM
>     >
>     > To:
>     > octave-maintainers <[hidden email]>
>     >
>     > List-Post:
>     > <mailto:[hidden email]>
>     > Content-Transfer-Encoding:
>     > 7Bit
>     > Precedence:
>     > list
>     > MIME-Version:
>     > 1.0
>     > Message-ID:
>     > <4081026.BqDeKUviz3@kerna>
>     > Content-Type:
>     > text/plain; charset="us-ascii"
>     > Message:
>     > 4
>     >
>     >
>     > I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).
>     >
>     > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
>     >
>     > % these examples work fine
>     > % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
>     > % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
>     >
>     > % these examples do NOT work
>     > for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
>     > % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
>     >
>     > linkaxes(ha, 'x')
>     >
>     > This is the error I'm finding:
>     >
>     > error: horizontal dimensions mismatch (1x1 vs 2x1)
>     > error: called from
>     >    linkprop at line 84 column 7
>     >    linkaxes at line 83 column 13
>     >
>     > ...
>     > a.
>     This was a simple error in using a comma, ',', for horizontal concatenation
>     when a semicolon, ';', was desired for vertical concatenation.  I fixed it
>     on the stable branch here
>     http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.
>    
>     --Rik
>    
>   Thank you
>   ....
>   a.
>  
> Unfortunately the commit didn't fix the issue. Could you please try to reproduce?
> ....
> a.
Works for me with the test code that was uncommented in your e-mail.

for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
linkaxes (ha, 'x')

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

avlas-2

El divendres, 27 d’abril de 2018, a les 13:42:10 EDT, Rik va escriure:

  On 04/27/2018 10:25 AM, avlas wrote:
  > El divendres, 27 d’abril de 2018, a les 13:10:51 EDT, avlas va escriure:
  >
  >   El divendres, 27 d’abril de 2018, a les 12:59:30 EDT, Rik va escriure:
  >  
  >     On 04/27/2018 07:33 AM, [hidden email] wrote:
  >     > Subject:
  >     > bug in linkaxes ?
  >     > From:
  >     > avlas <[hidden email]>
  >     > Date:
  >     > 04/27/2018 07:23 AM
  >     >
  >     > To:
  >     > octave-maintainers <[hidden email]>
  >     >
  >     > List-Post:
  >     > <mailto:[hidden email]>
  >     > Content-Transfer-Encoding:
  >     > 7Bit
  >     > Precedence:
  >     > list
  >     > MIME-Version:
  >     > 1.0
  >     > Message-ID:
  >     > <4081026.BqDeKUviz3@kerna>
  >     > Content-Type:
  >     > text/plain; charset="us-ascii"
  >     > Message:
  >     > 4
  >     >
  >     >
  >     > I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).
  >     >
  >     > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
  >     >
  >     > % these examples work fine
  >     > % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >     > % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >     >
  >     > % these examples do NOT work
  >     > for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >     > % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >     >
  >     > linkaxes(ha, 'x')
  >     >
  >     > This is the error I'm finding:
  >     >
  >     > error: horizontal dimensions mismatch (1x1 vs 2x1)
  >     > error: called from
  >     >    linkprop at line 84 column 7
  >     >    linkaxes at line 83 column 13
  >     >
  >     > ...
  >     > a.
  >     This was a simple error in using a comma, ',', for horizontal concatenation
  >     when a semicolon, ';', was desired for vertical concatenation.  I fixed it
  >     on the stable branch here
  >     http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.
  >    
  >     --Rik
  >    
  >   Thank you
  >   ....
  >   a.
  >  
  > Unfortunately the commit didn't fix the issue. Could you please try to reproduce?
  > ....
  > a.
  Works for me with the test code that was uncommented in your e-mail.
 
  for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  linkaxes (ha, 'x')
 
  --Rik
 
Strangely enough, it works for me too now. I updated the linkprop file on my own after running it, and somehow the change was not taken into account until I restarted Octave, which seems weird to me. I'd like to know if this is something general or related to flatpak :/

....
a.



Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

Rik-4
On 04/27/2018 10:52 AM, avlas wrote:

> El divendres, 27 d’abril de 2018, a les 13:42:10 EDT, Rik va escriure:
>
>   On 04/27/2018 10:25 AM, avlas wrote:
>   > El divendres, 27 d’abril de 2018, a les 13:10:51 EDT, avlas va escriure:
>   >
>   >   El divendres, 27 d’abril de 2018, a les 12:59:30 EDT, Rik va escriure:
>   >  
>   >     On 04/27/2018 07:33 AM, [hidden email] wrote:
>   >     > Subject:
>   >     > bug in linkaxes ?
>   >     > From:
>   >     > avlas <[hidden email]>
>   >     > Date:
>   >     > 04/27/2018 07:23 AM
>   >     >
>   >     > To:
>   >     > octave-maintainers <[hidden email]>
>   >     >
>   >     > List-Post:
>   >     > <mailto:[hidden email]>
>   >     > Content-Transfer-Encoding:
>   >     > 7Bit
>   >     > Precedence:
>   >     > list
>   >     > MIME-Version:
>   >     > 1.0
>   >     > Message-ID:
>   >     > <4081026.BqDeKUviz3@kerna>
>   >     > Content-Type:
>   >     > text/plain; charset="us-ascii"
>   >     > Message:
>   >     > 4
>   >     >
>   >     >
>   >     > I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).
>   >     >
>   >     > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
>   >     >
>   >     > % these examples work fine
>   >     > % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
>   >     > % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
>   >     >
>   >     > % these examples do NOT work
>   >     > for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
>   >     > % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
>   >     >
>   >     > linkaxes(ha, 'x')
>   >     >
>   >     > This is the error I'm finding:
>   >     >
>   >     > error: horizontal dimensions mismatch (1x1 vs 2x1)
>   >     > error: called from
>   >     >    linkprop at line 84 column 7
>   >     >    linkaxes at line 83 column 13
>   >     >
>   >     > ...
>   >     > a.
>   >     This was a simple error in using a comma, ',', for horizontal concatenation
>   >     when a semicolon, ';', was desired for vertical concatenation.  I fixed it
>   >     on the stable branch here
>   >     http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.
>   >    
>   >     --Rik
>   >    
>   >   Thank you
>   >   ....
>   >   a.
>   >  
>   > Unfortunately the commit didn't fix the issue. Could you please try to reproduce?
>   > ....
>   > a.
>   Works for me with the test code that was uncommented in your e-mail.
>  
>   for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
>   linkaxes (ha, 'x')
>  
>   --Rik
>  
> Strangely enough, it works for me too now. I updated the linkprop file on my own after running it, and somehow the change was not taken into account until I restarted Octave, which seems weird to me. I'd like to know if this is something general or related to flatpak :/
Probably flatpak.  Octave looks at the timestamp of an m-file each time it
is used to decide whether it needs to be re-compiled internally.  Unless
there was some weirdness with the file system, it should have seen the
updated file that was copied in to the search path and used it.

--Rik

Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

avlas-2
El divendres, 27 d’abril de 2018, a les 13:57:51 EDT, Rik va escriure:

  On 04/27/2018 10:52 AM, avlas wrote:
  > El divendres, 27 d’abril de 2018, a les 13:42:10 EDT, Rik va escriure:
  >
  >   On 04/27/2018 10:25 AM, avlas wrote:
  >   > El divendres, 27 d’abril de 2018, a les 13:10:51 EDT, avlas va escriure:
  >   >
  >   >   El divendres, 27 d’abril de 2018, a les 12:59:30 EDT, Rik va escriure:
  >   >  
  >   >     On 04/27/2018 07:33 AM, [hidden email] wrote:
  >   >     > Subject:
  >   >     > bug in linkaxes ?
  >   >     > From:
  >   >     > avlas <[hidden email]>
  >   >     > Date:
  >   >     > 04/27/2018 07:23 AM
  >   >     >
  >   >     > To:
  >   >     > octave-maintainers <[hidden email]>
  >   >     >
  >   >     > List-Post:
  >   >     > <mailto:[hidden email]>
  >   >     > Content-Transfer-Encoding:
  >   >     > 7Bit
  >   >     > Precedence:
  >   >     > list
  >   >     > MIME-Version:
  >   >     > 1.0
  >   >     > Message-ID:
  >   >     > <4081026.BqDeKUviz3@kerna>
  >   >     > Content-Type:
  >   >     > text/plain; charset="us-ascii"
  >   >     > Message:
  >   >     > 4
  >   >     >
  >   >     >
  >   >     > I think there is a bug in linkaxes, at least in my Octave version (flatpak package of Octave 4.3.91).
  >   >     >
  >   >     > Before submitting a bug report about this, could somebody please test the following code snippet? Thanks!
  >   >     >
  >   >     > % these examples work fine
  >   >     > % for ii = 1:3; ha(ii) = subplot(3,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >   >     > % for ii = 1:3; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >   >     >
  >   >     > % these examples do NOT work
  >   >     > for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >   >     > % for ii = 1:4; ha(ii) = subplot(2,2,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >   >     >
  >   >     > linkaxes(ha, 'x')
  >   >     >
  >   >     > This is the error I'm finding:
  >   >     >
  >   >     > error: horizontal dimensions mismatch (1x1 vs 2x1)
  >   >     > error: called from
  >   >     >    linkprop at line 84 column 7
  >   >     >    linkaxes at line 83 column 13
  >   >     >
  >   >     > ...
  >   >     > a.
  >   >     This was a simple error in using a comma, ',', for horizontal concatenation
  >   >     when a semicolon, ';', was desired for vertical concatenation.  I fixed it
  >   >     on the stable branch here
  >   >     http://hg.savannah.gnu.org/hgweb/octave/rev/2540fde5f07b.
  >   >    
  >   >     --Rik
  >   >    
  >   >   Thank you
  >   >   ....
  >   >   a.
  >   >  
  >   > Unfortunately the commit didn't fix the issue. Could you please try to reproduce?
  >   > ....
  >   > a.
  >   Works for me with the test code that was uncommented in your e-mail.
  >  
  >   for ii = 1:4; ha(ii) = subplot(4,1,ii); axes(ha(ii)); plot(randn(10,ii)); end
  >   linkaxes (ha, 'x')
  >  
  >   --Rik
  >  
  > Strangely enough, it works for me too now. I updated the linkprop file on my own after running it, and somehow the change was not taken into account until I restarted Octave, which seems weird to me. I'd like to know if this is something general or related to flatpak :/
  Probably flatpak.  Octave looks at the timestamp of an m-file each time it
  is used to decide whether it needs to be re-compiled internally.  Unless
  there was some weirdness with the file system, it should have seen the
  updated file that was copied in to the search path and used it.
 
  --Rik
 
I see. Thank you for the information. It's good to know to avoid misleading results when changing code, although changing Octave internal functions is not sth frequently needed.

....
a.



Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

Mike Miller-4
In reply to this post by avlas-2
On Fri, Apr 27, 2018 at 13:52:06 -0400, avlas wrote:
> Strangely enough, it works for me too now. I updated the linkprop file
> on my own after running it, and somehow the change was not taken into
> account until I restarted Octave, which seems weird to me. I'd like to
> know if this is something general or related to flatpak :/

Octave relies on the modification time of the directory containing a
function to know whether the files need to be read from the filesystem
again.

When I run a flatpak application, all files and directories under /app
have mtime set to 0 (1970-01-01 00:00:00). All files and directories are
also read-only, so I don't think there's a problem here.

I'm not sure what you did do, whether you successfully copied the file
or whether the write failed, or whether you tried to go behind flatpak's
back and update the real files. But it's best to consider everything
under /app to be read-only and not change it while the app is running.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: bug in linkaxes

avlas-2
El divendres, 27 d’abril de 2018, a les 14:03:27 EDT, Mike Miller va escriure:

  On Fri, Apr 27, 2018 at 13:52:06 -0400, avlas wrote:
  > Strangely enough, it works for me too now. I updated the linkprop file
  > on my own after running it, and somehow the change was not taken into
  > account until I restarted Octave, which seems weird to me. I'd like to
  > know if this is something general or related to flatpak :/
 
  Octave relies on the modification time of the directory containing a
  function to know whether the files need to be read from the filesystem
  again.
 
  When I run a flatpak application, all files and directories under /app
  have mtime set to 0 (1970-01-01 00:00:00). All files and directories are
  also read-only, so I don't think there's a problem here.

I see des 31  1969 as their date, which is fairly close to what you see
 
  I'm not sure what you did do, whether you successfully copied the file
  or whether the write failed, or whether you tried to go behind flatpak's
  back and update the real files. But it's best to consider everything
  under /app to be read-only and not change it while the app is running.
 
I tried to change the file within Octave but failed as I hadn't write permission, so I went to the terminal and replaced the file from Octave stable repo.

In the meantime the flatpak package has been updated to 4.3.92. As it does not include this fix yet, I'll try to repeat what I did to better understand when it happens...

....
a.