Opened 7 years ago
Closed 7 years ago
#18191 closed defect (fixed)
Automaton: representation string wrong for Automata with 1 state
Reported by:  Daniel Krenn  Owned by:  

Priority:  trivial  Milestone:  sage6.8 
Component:  finite state machines  Keywords:  sd64.25, beginner 
Cc:  Merged in:  
Authors:  Karen Kohl  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  9bd9f30 (Commits, GitHub, GitLab)  Commit:  9bd9f3045d9b7c8529bbb8be71dbf386708f68a6 
Dependencies:  Stopgaps: 
Description
sage: A = Automaton() sage: A.add_state(42) 42 sage: A Automaton with 1 states
The last line is wrong and should be "...with 1 state".
Change History (11)
comment:1 Changed 7 years ago by
Keywords:  beginner added 

comment:2 Changed 7 years ago by
Authors:  → Karen Kohl 

comment:3 Changed 7 years ago by
Branch:  → u/ktkohl/automaton__representation_string_wrong_for_automata_with_1_state 

comment:4 Changed 7 years ago by
Commit:  → b0c5a38590417f1bb52b132ccbf73aeb55276b8c 

Status:  new → needs_review 
comment:5 Changed 7 years ago by
Status:  needs_review → needs_work 

Hello,
While you are at it, this is also wrong
sage: FiniteStateMachine() Finite state machine with 0 states
It should rather be Empty finite state machine
.
Best Vincent
comment:6 Changed 7 years ago by
Commit:  b0c5a38590417f1bb52b132ccbf73aeb55276b8c → 9bd9f3045d9b7c8529bbb8be71dbf386708f68a6 

Branch pushed to git repo; I updated commit sha1. New commits:
9bd9f30  Changed representation string to say "empty" instead of "0 states" in all of Automaton, Finite State Machine, and Transducer.

comment:7 Changed 7 years ago by
Status:  needs_work → needs_review 

comment:8 Changed 7 years ago by
Reviewers:  → Vincent Delecroix 

Status:  needs_review → positive_review 
Hello,
For the future: the commit message should not be that long. It must start with a oneline description (~70 characters). Possibly you can add some more comments after a line break. Something like
"0 states" > "empty" for Finite State Machine We change the method _repr_ for Automaton, Finite State Machine and Transducer to be more friendly when there is no state.
Vincent
comment:10 Changed 7 years ago by
Keywords:  sd64.25 added; sd67 removed 

Milestone:  sage6.6 → sage6.8 
comment:11 Changed 7 years ago by
Branch:  u/ktkohl/automaton__representation_string_wrong_for_automata_with_1_state → 9bd9f3045d9b7c8529bbb8be71dbf386708f68a6 

Resolution:  → fixed 
Status:  positive_review → closed 
Note: See
TracTickets for help on using
tickets.
Also made the same correction for Transducer and FiniteStateMachine? in addition to Automaton.
New commits:
Changed representation string for Automaton, Transducer, and FiniteStateMachine.