Skip to content

Commit 457e853

Browse files
committed
doc updates
1 parent 63c0597 commit 457e853

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

_docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ does your bidding, but the initial euphoria has worn off.
2424
Bugs are cropping up. Data quirks are creeping in. Duplicate code is spreading like a
2525
virus across projects, or worse, inside the same project. Programs aren't `failing gracefully <http://en.wikipedia.org/wiki/Graceful_exit>`__.
2626

27-
There *must* be a better way, but not sure what path to follow.
27+
There *must* be a better way, but the path forward is not clear.
2828

2929
If you're like us and have had that itchy feeling, this tutorial is for you.
3030

_docs/phase4/candidates.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ What basic characteristics does a candidate have in the context of the
99

1010
Name, party and county election results jump out.
1111

12-
A candidate also has seems like a natural place for data transforms and
12+
A candidate also seems like a natural place for data transforms and
1313
computations that now live in *lib/parser.py* and *lib/summary.py*:
1414

1515
- candidate name parsing

_docs/phase4/races.rst

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
Races have Candidates!
22
======================
33

4-
TODO: NEED BETTER TRANSTION HERE
5-
* need headline that transtions to basic
6-
race info
7-
* Then lead into candidate housekeeping
4+
With the basics of our `Candidate` class out of the way, let's
5+
move on to building out the `Race` class. This higher-level
6+
class will manage updates to our candidate instances, along with metadata
7+
about the race itself such as election date and office/district.
88

9-
Races have a date, office, and possibly a district if it's a
10-
congressional office. They also, of course, have candidates. In *elex3*,
11-
the *lib/parsery.py* code managed candiates, ensuring that county-level
12-
results were assigned to the appropriate candidate.
9+
Recall that in *elex3*, the *lib/parsery.py* ensured that county-level results were assigned to the appropriate candidate.
10+
We'll now migrate that logic over to the `Race` class, along with a few other repsonsibilities:
1311

14-
We'll now migrate that logic over to the Race class, along with a few
15-
other repsonsibilities:
16-
17-
- Keep track of individual candidates and update their vote counts
18-
- Determine which, candidate, any, won the race
19-
- Track overall vote count in the race
12+
- Tracking overall vote count for the race
13+
- Updating candidates with new county-level votes
14+
- Determining which candidate, if any, won the race
2015

2116
Total votes
2217
-----------
2318

24-
The Race class keep a running tally of all votes. This represnts
25-
the sum of all votes received by individual candidates.
19+
The *Race* class keeps a running tally of all votes. This figure is
20+
the sum of all county-level votes received by individual candidates.
21+
22+
Let's build out the *Race* class with basic metadata fields and an *add\_result* method
23+
that updates the total vote count.
2624

27-
Let's build out our initial *Race* class with an *add\_result* method
28-
that handles these updates. This should be pretty straightforward, and
29-
you'll notice that the tests mirror those used to perform the vote
30-
tallies on *Candidate* instances.
25+
This should be pretty straight-forward, and you'll notice that the tests mirror those used to
26+
perform vote tallies on *Candidate* instances.
3127

3228
.. code:: python
3329

0 commit comments

Comments
 (0)