Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

words.CharacteristicSturmianWord does not do what it says #8140

Closed
seblabbe opened this issue Jan 31, 2010 · 16 comments
Closed

words.CharacteristicSturmianWord does not do what it says #8140

seblabbe opened this issue Jan 31, 2010 · 16 comments

Comments

@seblabbe
Copy link
Contributor

The doc of words.CharacteristicSturmianWord says :

INPUT:
-  ``cf`` - an iterator outputting integers (thought of as a
               continued fraction)

But it does not do what it says. In fact the following

sage: cf = CFF(1/golden_ratio^2)
sage: words.CharacteristicSturmianWord(cf)
word: 0010001001000100010010001001000100010010...

should output the same as

sage: words.FibonacciWord()
word: 0100101001001010010100100101001001010010...

CC: @sagetrac-abmasse

Component: combinatorics

Author: Sébastien Labbé

Reviewer: Alexandre Blondin Massé

Merged: sage-4.3.3.alpha0

Issue created by migration from https://trac.sagemath.org/ticket/8140

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 1, 2010

Attachment: trac_8140-sturmian-sl.patch.gz

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 1, 2010

comment:2

I just uploaded the patch : I corrected a sphinx warning. I hope it will not create conflicts if Alexandre started a review...

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Feb 3, 2010

comment:3

I reviewed this patch and made the following minor modifications, mostly in the documentation:

  • I gave three different equivalent definitions of characteristic Sturmian word as presented in the Lothaire book.
  • I changed the name of the variable cf for slope in the characteristic Sturmian.
  • I modified the NotImplementedError raised by the three functions by a ValueError. It seems more appropriate since values of slope are in general assumed to be in (0,1). Sébastien, if you still insist on keeping NotImplementedError, I would put a different message, something like "not implemented for values out of (0,1)"
  • I made other minor changes and updated the examples in consequence.
    All tests passed, the code seems good and correct the problem mentionned in this ticket. The doc is alright too.

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Feb 3, 2010

Author: slabbe

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Feb 3, 2010

Reviewer: abmasse

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Feb 3, 2010

Attachment: trac_8140-doc_fixes-abm.patch.gz

Few minor changes -- I let Sébastien check if he approves the changes

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 4, 2010

Attachment: trac_8140_cf-arg-sl.patch.gz

Applies over the two precedent patches.

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 4, 2010

comment:4

I agree with your changes. I fix the doc (the irrationality of alpha is necessary for the lower and upper mechanical word to be equal). I also added rename_keyword of the cf argument that you removed for backward compatibility.

I give a positive review to Alexandre's changes. Alexandre, I let you change the status of the ticket to positive review if you agree with my two patches.

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 4, 2010

Changed author from slabbe to Sébastien Labbé

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 4, 2010

comment:5

Full name in those boxes helps the release managers when writing the release notes.

@seblabbe
Copy link
Contributor Author

seblabbe commented Feb 4, 2010

Changed reviewer from abmasse to Alexandre Blondin-Massé

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Feb 4, 2010

Changed reviewer from Alexandre Blondin-Massé to Alexandre Blondin Massé

@sagetrac-abmasse
Copy link
Mannequin

sagetrac-abmasse mannequin commented Feb 4, 2010

comment:6

Rechecked the three functions after applying all three patches and everything looks fine. All tests passed, the doc built with Sphinx looks alright too and I agree with the last minor changes of Sébastien. Positive review as well !
Thanks for the info about the full names in the boxes, I wasn't sure what to do about that.

@qed777
Copy link
Mannequin

qed777 mannequin commented Feb 10, 2010

comment:7

The commit string for the third patch is not sufficiently descriptive. I've refreshed it in my queue for 4.3.3.alpha0: #8140: Added rename_keyword for the cf argument. Please let me know if this is not good enough!

@seblabbe
Copy link
Contributor Author

comment:8

Replying to @qed777:

The commit string for the third patch is not sufficiently descriptive. I've refreshed it in my queue for 4.3.3.alpha0: #8140: Added rename_keyword for the cf argument. Please let me know if this is not good enough!

It is perfect (sorry, I forgot to write the description).

@qed777
Copy link
Mannequin

qed777 mannequin commented Feb 11, 2010

Merged: sage-4.3.3.alpha0

@qed777 qed777 mannequin removed the s: positive review label Feb 11, 2010
@qed777 qed777 mannequin closed this as completed Feb 11, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant