Created by Alex Chiang and last modified
Get this branch:
bzr branch lp:~achiang/streamflow/fix-zero-days
Only Alex Chiang can upload to this branch. If you are Alex Chiang please log in for upload directions.

Branch merges

Related bugs

Related blueprints

Branch information

Alex Chiang

Recent revisions

12. By Alex Chiang

Account for years with only 0.00 flow days

If we encounter a year with only 0.00 flow days, we will never set
a max flow day, and we blow up when trying to print a non-existent

The fix is simple: initialize the max_flow_day and max_flow_month
to dummy values so that we can print something in this case.

11. By Alex Chiang

Merge from lp:~lindsayvail/streamflow/newheader

10. By Alex Chiang

Fix "zero days" count

We can no longer naively use the count() function to figure out how many
days had zero flow. This is because instead of storing the flow data
directly in the years{} dict, we are now storing a (date, flow) tuple.

The fix is simple: loop through the (date, flow) tuples and count them

9. By Lindsay Reynolds

Alex made some sweet new changes.

8. By Lindsay Reynolds

Unindented (once) lines 88-137 which printed headers at the top of the data column rows. Fixed indentation at lines 105-106 so that average daily flow is calculated correctly.

7. By Lindsay Reynolds

Indented everything lines 94-137 four spaces

6. By Lindsay Reynolds

Changed all the hard tabs to four spaces each

5. By Lindsay Reynolds

Attempt to put data in adjacent columns. Also tried to add metrics: Annual maximum flow, Date of Minimum flow and Date of Maximum flow.

4. By Alex Chiang

Fix metric calculations, properly taking "no data" days into account

We allow days with no stream flow into our data set. However, we must
properly handle them when calculating our metrics.

We can't add a python None data type to a floating point, so add a few
checks to ensure we won't blow up when we encounter a day without data.
Adjust the calculation for the average daily flow accordingly; a day
without data shouldn't be considered when calculating the average.

3. By Alex Chiang

Treat no data days differently from zero flow days

Previously, we were treating days without data as equivalent to days
with zero flow. This was incorrect; in fact we care very much about
days with zero flow.

Stop treating a "no data" day as a zero flow day.

Additionally, since we are interested in taking a yearly view of the data
we now throw away the years that have >= 5 days without data.

These changes make several of our other calculations easier. Since we
are interested in zero flow days, we allow 0.0 to be a valid value for
the annual minimum flow, and no longer have to do a silly dance when
calculating that metric.

Branch metadata

Branch format:
Branch format 7
Repository format:
Bazaar repository format 2a (needs bzr 1.16 or later)
Stacked on:
This branch contains Public information 
Everyone can see this information.