bugGNU Octave - Bugs: bug #54288, some small patches for Octave...

 
 

bug #54288: some small patches for Octave 4.4.0 document

Submitter:  None
Submitted:  Wed 11 Jul 2018 10:43:48 AM UTC
   
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Documentation
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.4.0
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 12 Jul 2018 04:21:38 PM UTC, comment #3: 

I checked and you are correct that "warning (mode_struct)" is not a valid calling form.  I made the documentation change here: https://hg.savannah.gnu.org/hgweb/octave/rev/5f63ca41eacb.

Rik <rik5>
Group administrator
Thu 12 Jul 2018 12:48:12 AM UTC, comment #2: 

Thank maintainer, as always, for fixing so many bugs every day.

I did some more trying, and found that it seems that if we use

warning (MODE_STRUCT)

then the function also thinks we are using the syntax

warning (WARNING_STRUCT)

to change the state of warnings rather than modes.

If it is so, the last line in the docstring header

@deftypefnx {} {} warning (@var{mode_struct})

should be removed.

The function "warning" is not in an M-file.  I'm not familiar with C++, so I was just guessing the behavior from the output.  Maybe my guess is wrong.

Below is the output:

octave:1>  warning
By default, warnings are enabled.

    off  Octave:array-as-logical
    off  Octave:array-to-scalar
    off  Octave:array-to-vector
    off  Octave:imag-to-real
    off  Octave:language-extension
    off  Octave:missing-semicolon
    off  Octave:neg-dim-as-zero
    off  Octave:resize-on-range-error
    off  Octave:separator-insert
    off  Octave:single-quote-string
    off  Octave:str-to-num
    off  Octave:mixed-string-concat
    off  Octave:variable-switch-label

octave:2>  s = warning("off","verbose")
s =

  scalar structure containing the fields:

    identifier = verbose
    state = on

octave:3>  warning
By default, warnings are enabled.

    off  Octave:array-as-logical
    off  Octave:array-to-scalar
    off  Octave:array-to-vector
    off  Octave:imag-to-real
    off  Octave:language-extension
    off  Octave:missing-semicolon
    off  Octave:neg-dim-as-zero
    off  Octave:resize-on-range-error
    off  Octave:separator-insert
    off  Octave:single-quote-string
    off  Octave:str-to-num
    off  Octave:mixed-string-concat
    off  Octave:variable-switch-label

octave:4>  warning(s)
octave:5>  warning
By default, warnings are enabled.

    off  Octave:array-as-logical
    off  Octave:array-to-scalar
    off  Octave:array-to-vector
    off  Octave:imag-to-real
    off  Octave:language-extension
    off  Octave:missing-semicolon
    off  Octave:neg-dim-as-zero
    off  Octave:resize-on-range-error
    off  Octave:separator-insert
    off  Octave:single-quote-string
    off  Octave:str-to-num
    off  Octave:mixed-string-concat
    off  Octave:variable-switch-label
     on  verbose

octave:6>  warning("off","verbose")
octave:7>  warning
By default, warnings are enabled.

    off  Octave:array-as-logical
    off  Octave:array-to-scalar
    off  Octave:array-to-vector
    off  Octave:imag-to-real
    off  Octave:language-extension
    off  Octave:missing-semicolon
    off  Octave:neg-dim-as-zero
    off  Octave:resize-on-range-error
    off  Octave:separator-insert
    off  Octave:single-quote-string
    off  Octave:str-to-num
    off  Octave:mixed-string-concat
    off  Octave:variable-switch-label
     on  verbose

octave:8>


Anonymous
Wed 11 Jul 2018 03:42:36 PM UTC, comment #1: 

This looks very good.  It's a large manual (> 1000 pages) and clearly you have looked carefully at nearly every page.  The only change I didn't make was this one:


@@ -1530,8 +1530,8 @@
 enable/disable the display of additional information after the warning message
 @end table

-In this case the @var{state} argument may only be @qcode{"on"} or
-@qcode{"off"}.
+In this case the @var{state} argument may only be @qcode{"on"},
+@qcode{"off"}, or @qcode{"query"}.

 Implementation Note: For compatibility with @sc{matlab}, escape sequences in
 @var{template} (e.g., @qcode{"@xbackslashchar{}n"} => newline) are processed


In this case, it is correct that the mode can only be "off" or "on".  If you use "query" then the function thinks you are using the syntax


warning ("query", WARNING_ID)


so


octave:1> warning ("query", "verbose")
ans =

  scalar structure containing the fields:

    identifier = verbose
    state = off

octave:2> warning ("on", "verbose")
octave:3>


I checked in the changes on the stable branch here http://hg.savannah.gnu.org/hgweb/octave/rev/07c2c42f457e.  This will be part of the 4.4.1 bug fix release soon.

Marking as fixed and closing report.

Rik <rik5>
Group administrator
Wed 11 Jul 2018 10:43:48 AM UTC, original submission:  

Some small issues found in the whole document of Octave 4.4.0.

Summary:
Chapter A.3: redundant "do do"
OCTAVE_EXEC_HOME: function name misplaced
warning: rename "mode_st" to "mode_struct" for consistency; mode state can also be "query"
num2hex: missing '"'
octave_core_file_limit: redundant "is is"; redundant ')'
quad2d, integral2, integral3: replace 'x' into '*' for consistency
warning_ids: "Octave:erase:chararray" misplaced
decic: quote variable "y" and "yp"
pqpnonneg, lsqnonneg: missing ')'
bicg: redundant ';;'
betaincinv: redundant ')'

Possible patch:

diff -ur a/examples/code/embedded.cc b/examples/code/embedded.cc
--- a/examples/code/embedded.cc
+++ b/examples/code/embedded.cc
@@ -33,7 +33,7 @@
       //       exit (status);
       //     }
       //
-      // You may skip this step if you don't need to do do anything
+      // You may skip this step if you don't need to do anything
       // between reading the startup files and telling the interpreter
       // that you are ready to execute commands.

diff -ur a/libinterp/corefcn/defaults.cc b/libinterp/corefcn/defaults.cc
--- a/libinterp/corefcn/defaults.cc
+++ b/libinterp/corefcn/defaults.cc
@@ -339,7 +339,7 @@

 DEFUN (OCTAVE_EXEC_HOME, args, ,
        doc: /* -*- texinfo -*-
-@deftypefn {} {} OCTAVE_HOME ()
+@deftypefn {} {} OCTAVE_EXEC_HOME ()
 Return the name of the top-level Octave installation directory for
 architecture-dependent files.  If not specified separately, the value
 is the same as OCTAVE_HOME@.  OCTAVE_EXEC_HOME corresponds to the
diff -ur a/libinterp/corefcn/error.cc b/libinterp/corefcn/error.cc
--- a/libinterp/corefcn/error.cc
+++ b/libinterp/corefcn/error.cc
@@ -1438,7 +1438,7 @@
 @deftypefnx {} {} warning (@var{warning_struct})
 @deftypefnx {} {@var{warning_struct} =} warning (@dots{})
 @deftypefnx {} {@var{mode_struct} =} warning (@var{state}, @var{mode})
-@deftypefnx {} {} warning (@var{mode_st})
+@deftypefnx {} {} warning (@var{mode_struct})

 Display a warning message or control the behavior of Octave's warning system.

@@ -1530,8 +1530,8 @@
 enable/disable the display of additional information after the warning message
 @end table

-In this case the @var{state} argument may only be @qcode{"on"} or
-@qcode{"off"}.
+In this case the @var{state} argument may only be @qcode{"on"},
+@qcode{"off"}, or @qcode{"query"}.

 Implementation Note: For compatibility with @sc{matlab}, escape sequences in
 @var{template} (e.g., @qcode{"@xbackslashchar{}n"} => newline) are processed
diff -ur a/libinterp/corefcn/hex2num.cc b/libinterp/corefcn/hex2num.cc
--- a/libinterp/corefcn/hex2num.cc
+++ b/libinterp/corefcn/hex2num.cc
@@ -294,7 +294,7 @@
 @end group
 @end example

-With the optional second argument @qcode{"cell}, return a cell array of
+With the optional second argument @qcode{"cell"}, return a cell array of
 strings instead of a character array.
 @seealso{hex2num, hex2dec, dec2hex}
 @end deftypefn */)
diff -ur a/libinterp/corefcn/load-save.cc b/libinterp/corefcn/load-save.cc
--- a/libinterp/corefcn/load-save.cc
+++ b/libinterp/corefcn/load-save.cc
@@ -1799,8 +1799,8 @@
 that Octave will save when writing a crash dump file.

 The limit is measured in kilobytes and is applied to the top-level workspace.
-The name of the crash dump file is is specified by
-@var{octave_core_file_name}).
+The name of the crash dump file is specified by
+@var{octave_core_file_name}.

 If @var{octave_core_file_options} flags specify a binary format, then
 @var{octave_core_file_limit} will be approximately the maximum size of the
diff -ur a/scripts/general/integral2.m b/scripts/general/integral2.m
--- a/scripts/general/integral2.m
+++ b/scripts/general/integral2.m
@@ -88,7 +88,7 @@
 ## @end example
 ##
 ## The result is a volume, which for this constant-value integrand, is just
-## @code{@var{Length} * @var{Width} x @var{Height}}.
+## @code{@var{Length} * @var{Width} * @var{Height}}.
 ##
 ## Example 2 : integrate a triangular region in x-y plane
 ##
diff -ur a/scripts/general/integral3.m b/scripts/general/integral3.m
--- a/scripts/general/integral3.m
+++ b/scripts/general/integral3.m
@@ -89,7 +89,7 @@
 ## @end example
 ##
 ## For this constant-value integrand, the result is a volume which is just
-## @code{@var{Length} * @var{Width} x @var{Height}}.
+## @code{@var{Length} * @var{Width} * @var{Height}}.
 ##
 ## Example 2 : integrate over a spherical volume
 ##
diff -ur a/scripts/general/quad2d.m b/scripts/general/quad2d.m
--- a/scripts/general/quad2d.m
+++ b/scripts/general/quad2d.m
@@ -93,7 +93,7 @@
 ## @end example
 ##
 ## The result is a volume, which for this constant-value integrand, is just
-## @code{@var{Length} * @var{Width} x @var{Height}}.
+## @code{@var{Length} * @var{Width} * @var{Height}}.
 ##
 ## Example 2 : integrate a triangular region in x-y plane
 ##
diff -ur a/scripts/help/warning_ids.m b/scripts/help/warning_ids.m
--- a/scripts/help/warning_ids.m
+++ b/scripts/help/warning_ids.m
@@ -174,8 +174,7 @@
 ## If the @code{Octave:erase:chararray} warning is enabled then the erase
 ## function will issue a warning if the input pattern is a character array
 ## rather than a string or cell array of strings.
-## By default, the @code{Octave:eigs:UnconvergedEigenvalues} warning is
-## enabled.
+## By default, the @code{Octave:erase:chararray} warning is enabled.
 ##
 ## @item Octave:data-file-in-path
 ## If the @code{Octave:data-file-in-path} warning is enabled, a warning is
diff -ur a/scripts/ode/decic.m b/scripts/ode/decic.m
--- a/scripts/ode/decic.m
+++ b/scripts/ode/decic.m
@@ -61,9 +61,9 @@
 ## compute the initial conditions.
 ##
 ## The function typically returns two outputs.  Variable @var{y0_new} is a
-## column vector and contains the consistent initial value of y.  The output
+## column vector and contains the consistent initial value of @var{y}.  The output
 ## @var{yp0_new} is a column vector and contains the consistent initial value
-## of yp.
+## of @var{yp}.
 ##
 ## The optional third output @var{resnorm} is the norm of the vector of
 ## residuals.  If @var{resnorm} is small, @code{decic} has successfully
diff -ur a/scripts/optimization/lsqnonneg.m b/scripts/optimization/lsqnonneg.m
--- a/scripts/optimization/lsqnonneg.m
+++ b/scripts/optimization/lsqnonneg.m
@@ -36,7 +36,7 @@
 ## @var{x0} is an optional initial guess for the solution @var{x}.
 ##
 ## @var{options} is an options structure to change the behavior of the
-## algorithm (@pxref{XREFoptimset,,optimset}.  @code{lsqnonneg} recognizes
+## algorithm (@pxref{XREFoptimset,,optimset}).  @code{lsqnonneg} recognizes
 ## these options: @qcode{"MaxIter"}, @qcode{"TolX"}.
 ##
 ## Outputs:
diff -ur a/scripts/optimization/pqpnonneg.m b/scripts/optimization/pqpnonneg.m
--- a/scripts/optimization/pqpnonneg.m
+++ b/scripts/optimization/pqpnonneg.m
@@ -36,7 +36,7 @@
 ## @var{x0} is an optional initial guess for the solution @var{x}.
 ##
 ## @var{options} is an options structure to change the behavior of the
-## algorithm (@pxref{XREFoptimset,,optimset}.  @code{pqpnonneg} recognizes
+## algorithm (@pxref{XREFoptimset,,optimset}).  @code{pqpnonneg} recognizes
 ## one option: @qcode{"MaxIter"}.
 ##
 ## Outputs:
diff -ur a/scripts/sparse/bicg.m b/scripts/sparse/bicg.m
--- a/scripts/sparse/bicg.m
+++ b/scripts/sparse/bicg.m
@@ -142,7 +142,7 @@
 ## M1fun = @@(x, string) strcmp (string, "notransp") * (M1 \ x) + ...
 ##                      strcmp (string, "transp") * (M1' \ x);
 ## M2fun = @@(x, string) strcmp (string, "notransp") * (M2 \ x) + ...
-##                      strcmp (string, "transp") * (M2' \ x);;
+##                      strcmp (string, "transp") * (M2' \ x);
 ## @end group
 ## @end example
 ##
diff -ur a/scripts/specfun/betaincinv.m b/scripts/specfun/betaincinv.m
--- a/scripts/specfun/betaincinv.m
+++ b/scripts/specfun/betaincinv.m
@@ -55,7 +55,7 @@
 ## The variable @var{y} must be in the interval [0,1], while @var{a} and
 ## @var{b} must be real and strictly positive.
 ##
-## By default, @var{tail} is @qcode{"lower")} and the inverse of the incomplete
+## By default, @var{tail} is @qcode{"lower"} and the inverse of the incomplete
 ## beta function integrated from 0 to @var{x} is computed.  If @var{tail} is
 ## @qcode{"upper"} then the complementary function integrated from @var{x} to 1
 ## is inverted.


Anonymous

 

(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 rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-07-11 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code