#12498: Return Integer from GeneralDiscreteDistribution
--------------------------+-------------------------------------------------
   Reporter:  ppurka      |          Owner:  amhou                             
       Type:  defect      |         Status:  needs_review                      
   Priority:  minor       |      Milestone:  sage-5.0                          
  Component:  statistics  |       Keywords:  GeneralDiscreteDistribution import
Work_issues:              |       Upstream:  N/A                               
   Reviewer:              |         Author:                                    
     Merged:              |   Dependencies:                                    
--------------------------+-------------------------------------------------
Changes (by ppurka):

  * status:  new => needs_review


Old description:

> 1. The output of `GeneralDiscreteDistribution().get_random_element()` is
> not a Sage number per se and hence has no `parent` attribute.
>
> 2. The import of sage.rings.real_double seems unnecessary in the file
> `devel/sage/sage/gsl/probability_distribution.pyx` since all the calls to
> RDF are made explicitly as `sage.rings.real_double.RDF` in the entire
> file.
>
> Attaching a patch to fix both the above issues. The patch passes all
> doctests in `devel/sage/sage/gsl`.

New description:

 1. The output of `GeneralDiscreteDistribution().get_random_element()` is
 not a Sage number per se and hence has no `parent` attribute.

 2. The import of sage.rings.real_double seems unnecessary in the file
 `devel/sage/sage/gsl/probability_distribution.pyx` since all the calls to
 RDF are made explicitly as `sage.rings.real_double.RDF` in the entire
 file.

 Attaching a patch to fix both the above issues. The patch passes all
 doctests in `devel/sage/sage/gsl`.
 ----
 Apply [attachment:trac_12498-return-Integer-from-
 GeneralDiscreteDistribution.patch] to `devel/sage`

--

Comment:

 All tests pass except for cmdline.py. I checked this test on an unmodified
 sage-4.8 and it fails exactly similarly on the unmodified sage. The
 directory `sage-4.8.good` is the unmodified sage below, while the
 directory `sage-4.8` contains these modifications along with #11080
 {{{
 ...stallations/sage-4.8.good> ./sage -t  --long -force_lib
 devel/sage/sage/tests/cmdline.py
 sage -t --long -force_lib "devel/sage/sage/tests/cmdline.py"
 **********************************************************************
 File
 "/home/punarbasu/Installations/sage-4.8.good/devel/sage/sage/tests/cmdline.py",
 line 95:
     sage: out.find(version()) >= 0
 Expected:
     True
 Got:
     False
 **********************************************************************
 File
 "/home/punarbasu/Installations/sage-4.8.good/devel/sage/sage/tests/cmdline.py",
 line 103:
     sage: out.find(version()) >= 0
 Expected:
     True
 Got:
     False
 **********************************************************************
 File
 "/home/punarbasu/Installations/sage-4.8.good/devel/sage/sage/tests/cmdline.py",
 line 175:
     sage: out.find(version()) >= 0
 Expected:
     True
 Got:
     False
 **********************************************************************
 1 items had failures:
    3 of 160 in __main__.example_1
 ***Test Failed*** 3 failures.
 For whitespace errors, see the file
 /home/punarbasu/.sage//tmp/cmdline_21847.py
          [67.8 s]

 ----------------------------------------------------------------------
 The following tests failed:


         sage -t --long -force_lib "devel/sage/sage/tests/cmdline.py"
 Total time for all tests: 68.0 seconds
 ...ions/sage-4.8.good [128] > ../sage-4.8
 ~/Installations/sage-4.8>
 ~/Installations/sage-4.8> ./sage -t  --long -force_lib
 devel/sage/sage/tests/cmdline.py
 sage -t --long -force_lib "devel/sage/sage/tests/cmdline.py"
 **********************************************************************
 File
 "/home/punarbasu/Installations/sage-4.8/devel/sage/sage/tests/cmdline.py",
 line 95:
     sage: out.find(version()) >= 0
 Expected:
     True
 Got:
     False
 **********************************************************************
 File
 "/home/punarbasu/Installations/sage-4.8/devel/sage/sage/tests/cmdline.py",
 line 103:
     sage: out.find(version()) >= 0
 Expected:
     True
 Got:
     False
 **********************************************************************
 File
 "/home/punarbasu/Installations/sage-4.8/devel/sage/sage/tests/cmdline.py",
 line 175:
     sage: out.find(version()) >= 0
 Expected:
     True
 Got:
     False
 **********************************************************************
 1 items had failures:
    3 of 160 in __main__.example_1
 ***Test Failed*** 3 failures.
 For whitespace errors, see the file
 /home/punarbasu/.sage//tmp/cmdline_22200.py
          [18.9 s]

 ----------------------------------------------------------------------
 The following tests failed:


         sage -t --long -force_lib "devel/sage/sage/tests/cmdline.py"
 Total time for all tests: 18.9 seconds
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12498#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to