Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#8465 closed defect (fixed)

move the document "Python Functional Programming for Mathematicians" to the classification "Thematic Tutorials"

Reported by: mvngu Owned by: mvngu
Priority: blocker Milestone: sage-4.5.2
Component: documentation Keywords: Sage HOWTOs
Cc: leif, mpatel Merged in: sage-4.5.2.rc0
Authors: Minh Van Nguyen, John Palmieri Reviewers: John Palmieri, Leif Leonhardy
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mvngu)

The new documentation classification "Thematic Tutorials" aims to include various in-depth documentation/tutorials on specific topics. Here, we move the chapter Python Functional Programming for Mathematicians to the "Thematic Tutorials" classification. The original proposal can be found on sage-devel and sage-combinat-devel.

Notes: The current ticket needs to be coordinated with #8470.

Prerequisites: #8480, #8464

Attachments (4)

trac_8465-functional.patch (35.2 KB) - added by mvngu 12 years ago.
based on Sage 4.3.4.alpha1
trac_8465-v2.patch (31.5 KB) - added by jhpalmieri 12 years ago.
based on 4.5.2.alpha1. apply only this patch.
trac_8442-config.patch (1.4 KB) - added by jhpalmieri 12 years ago.
apply on top of trac_8465-v2.patch
trac_8465-fix_typo.patch (755 bytes) - added by mpatel 12 years ago.
Fix website index.html typo. Apply on top of other two patches.

Download all attachments as: .zip

Change History (27)

comment:1 Changed 12 years ago by mvngu

  • Description modified (diff)

comment:2 Changed 12 years ago by mvngu

  • Description modified (diff)
  • Summary changed from move the document "Python Functional Programming for Mathematicians" to the classification "Sage HOWTOs" to move the document "Python Functional Programming for Mathematicians" to the classification "Thematic Tutorials"

comment:3 Changed 12 years ago by mvngu

  • Description modified (diff)

comment:4 Changed 12 years ago by mvngu

  • Authors set to Minh Van Nguyen
  • Description modified (diff)
  • Status changed from new to needs_review

Changed 12 years ago by mvngu

based on Sage 4.3.4.alpha1

comment:5 Changed 12 years ago by schilly

i hope that's the correct place to point out some ideas i have: (at least, i found them very useful to know when i coded something recently)

  1. reduce will be part of the functools module in python 3. might be

helpful to import it from there to make it forward compatible http://docs.python.org/library/functools.html <- or at least you might wanna add a link to that module in the bottom section.

  1. http://docs.python.org/library/itertools.html#itertools.starmap is

quite cool if you have "izip"ed values for the function arguments. i.e. starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000. it's like f(a,b) vs. f(*c)

  1. Besides that, have you explained the generator concept with the

"yield" keyword? I'm not sure if that counts as functional programming but it is a nice topic in that context.

comment:6 Changed 12 years ago by mjordan7

Tested well, and looks good on Boxen. In the styles of programming section, the object-oriented example seemed a little contrived, and I would say was bad style to make an object for adding two things. I believe a better example would to use comparison instead of adding. Something procedural

def compare(a, b)

return a - b;

versus like this for object-oriented

def class Comparable

def compare(b)

return self - b;

~Mark

comment:7 Changed 12 years ago by malb

  • Status changed from needs_review to needs_work

Minh, I'm setting this to needs work in light of the comments by Mark. If you don't feel this is justified could you briefly explain why here and then change it back to needs review?

comment:8 Changed 12 years ago by jhpalmieri

Two other comments: I don't think we need the file doc/en/thematic_tutorials/Makefile. Also, the file index.rst should include a line for the group_theory document.

comment:9 Changed 12 years ago by leif

  • Cc leif added

comment:10 Changed 12 years ago by jhpalmieri

  • Status changed from needs_work to needs_review

Here is a new patch. This removes the file Makefile and adds group_theory and a descriptive sentence to index.rst.

As far as the comments above, they are beyond the scope of this ticket. The point of this ticket was to move the file functional_programming.rst from the constructions document to the thematic tutorials document. I think that some of the comments have some merit, but they involve revising that document. I've opened #9612 for those revisions.

So I'm returning this to "needs review". I'm actually happy with the original ticket, so the only things that need reviewing are the changes I made to index.rst, as well as the removal of Makefile.

comment:11 Changed 12 years ago by leif

  • Authors changed from Minh Van Nguyen to Minh Van Nguyen, John Palmieri
  • Priority changed from major to critical
  • Reviewers set to John Palmieri, Leif Leonhardy
  • Status changed from needs_review to needs_work
  • Type changed from enhancement to defect
  • Work issues set to Update dangling reference
sphinx-build -b html -d /home/leif/sage-4.5.2.alpha1/devel/sage/doc/output/doctrees/en/constructions    /home/leif/sage-4.5.2.alpha1/devel/sage/doc/en/constructions /home/leif/sage-4.5.2.alpha1/devel/sage/doc/output/html/en/constructions
Running Sphinx v0.6.3
...
/home/leif/sage-4.5.2.alpha1/devel/sage/doc/en/constructions/index.rst:28: (WARNING/2) toctree references unknown document u'functional_programming'
...
build succeeded, 1 warning.

...

sphinx-build -b html -d /home/leif/sage-4.5.2.alpha1/devel/sage/doc/output/doctrees/en/thematic_tutorials    /home/leif/sage-4.5.2.alpha1/devel/sage/doc/en/thematic_tutorials /home/leif/sage-4.5.2.alpha1/devel/sage/doc/output/html/en/thematic_tutorials
Running Sphinx v0.6.3
loading pickled environment... not found
building [html]: targets for 3 source files that are out of date
updating environment: 3 added, 0 changed, 0 removed
reading sources... [ 33%] functional_programming
reading sources... [ 66%] group_theory
reading sources... [100%] index

looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [ 33%] functional_programming
writing output... [ 66%] group_theory
writing output... [100%] index

writing additional files... genindex search
copying static files... done
dumping search index... done
dumping object inventory... done
build succeeded.
Build finished.  The built documents can be found in /home/leif/sage-4.5.2.alpha1/devel/sage/doc/output/html/en/thematic_tutorials

...

(The bottom part is just informational.)

So just little work needed (dangling reference).

Thanks though for fixing this "eternal" error... ;-)

Changing this to "critical" and "defect", since actually this patch fixes a Sphinx build error.

Changed 12 years ago by jhpalmieri

based on 4.5.2.alpha1. apply only this patch.

comment:12 Changed 12 years ago by jhpalmieri

  • Status changed from needs_work to needs_review

This patch should fix that problem. (Only change: remove one line in doc/en/constructions/index.rst.)

comment:13 Changed 12 years ago by jhpalmieri

  • Work issues Update dangling reference deleted

comment:14 Changed 12 years ago by leif

Hmmm, I might be stupid, but I cannot find the Thematic Tutorials in (or from) the main index devel/sage/doc/output/html/en/index.html.

Sorry, didn't look for that before...

The (re)build of the HTML documents now works as expected (without new warnings).

comment:15 follow-up: Changed 12 years ago by jhpalmieri

Hmmm, I might be stupid, but I cannot find the Thematic Tutorials in (or from) the main index devel/sage/doc/output/html/en/index.html.

I think it gets added in #8442.

comment:16 in reply to: ↑ 15 Changed 12 years ago by leif

Replying to jhpalmieri:

Hmmm, I might be stupid, but I cannot find the Thematic Tutorials in (or from) the main index devel/sage/doc/output/html/en/index.html.

I think it gets added in #8442.

So can you merge the patch to doc/en/website/templates/index.html from http://trac.sagemath.org/sage_trac/attachment/ticket/8442/trac_8442-config.patch (if that's the correct one)?

Changed 12 years ago by jhpalmieri

apply on top of trac_8465-v2.patch

comment:17 Changed 12 years ago by jhpalmieri

Okay, here you go.

comment:18 Changed 12 years ago by jhpalmieri

I should have renamed the new patch. Despite its name, it does belong on this ticket, #8465. The commit message has the correct ticket number.

If this is merged, we'll need to rebase some of the patches related to #8470, since some of those include the same changes to conf.py and to website/templates/index.html.

comment:19 follow-up: Changed 12 years ago by leif

  • Status changed from needs_review to positive_review

Cool!

Note to the release managers

Apply only trac_8465-v2.patch and (despite its name) trac_8442-config.patch.

(The latter is only a part of http://trac.sagemath.org/sage_trac/attachment/ticket/8442/trac_8442-config.patch)

comment:20 Changed 12 years ago by ddrake

  • Priority changed from critical to blocker

Making a blocker so this gets into 4.5.2; it fixes a documentation build error.

comment:21 Changed 12 years ago by mpatel

  • Cc mpatel added

Changed 12 years ago by mpatel

Fix website index.html typo. Apply on top of other two patches.

comment:22 in reply to: ↑ 19 Changed 12 years ago by mpatel

  • Merged in set to sage-4.5.2.rc0
  • Resolution set to fixed
  • Status changed from positive_review to closed

Replying to leif:

Note to the release managers

Apply only trac_8465-v2.patch and (despite its name) trac_8442-config.patch.

I'm merging these and a new trac_8465-fix_typo.patch into 4.5.2.rc0. Can someone please check the latter? There's no need to add me as an author.

comment:23 Changed 12 years ago by jhpalmieri

The typo patch is fine.

Note: See TracTickets for help on using tickets.