lp://staging/~achiang/streamflow/fix-zero-days
- Get this branch:
- bzr branch lp://staging/~achiang/streamflow/fix-zero-days
Branch merges
Branch information
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
variable.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. - 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
manually. - 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.
- 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:
- lp://staging/streamflow