From c82ed82abad4aba201ae7658251a69c806be646e Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 27 Jul 2025 21:56:59 +0200 Subject: [PATCH] add productivity per caver for each expo --- core/views/statistics.py | 8 +++++++- templates/statistics.html | 11 +++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/core/views/statistics.py b/core/views/statistics.py index 30fc1b5f..7bf65206 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -32,7 +32,13 @@ def legs_by_expo(expos): legsyear += int(sb.legsall) addupsurvexlength += survexleglength addupsurvexlegs += legsyear - legsbyexpo.append((expedition, {"nsurvexlegs": legsyear, "survexleglength": survexleglength})) + + expoers = PersonExpedition.objects.filter(expedition=expedition).count() + if expoers > 0: + success = survexleglength/expoers + else: + success = "" + legsbyexpo.append((expedition, {"success":success, "people": expoers, "nsurvexlegs": legsyear, "survexleglength": survexleglength})) legsbyexpo.reverse() return legsbyexpo, addupsurvexlegs, addupsurvexlength diff --git a/templates/statistics.html b/templates/statistics.html index 2daec6a8..44b6eec4 100644 --- a/templates/statistics.html +++ b/templates/statistics.html @@ -10,25 +10,28 @@

Number of survey legs: {{nsurvexlegs}}
Total length: {{addupsurvexlength|stringformat:".1f"}} km adding up the total for each year.

-

These are uncorrected tape lengths which include pitches and duplicates but exclude splays or surface-surveys. +

These are uncorrected tape lengths which include pitches and duplicates but exclude splays or surface-surveys. They are also before any loop-closure corrections.

-

This only includes lengths surveyed by Expo survey trips (though not all have valid Expo-attendees as some survex files are administrative collections of *include statements). This no longer (since 30 June 2025) includes ARGE and other non-expo surveys. +

This only includes lengths surveyed by Expo survey trips (though not all have valid Expo-attendees as some survex files are administrative collections of *include statements). This no longer (since 30 June 2025) includes non-expo surveys (ARGE and others). - + {% for legs in legsbyexpo %} + + {% endfor %}
YearSurvex
Survey
Blocks
Survex
Survey Legs
Survex
length(m)
YearSurvex
Survey
Blocks
Survex
Survey Legs
Survex
length(m)
Caversmeters/caver
{{legs.0}} {{legs.0.survexblock_set.all|length}} {{legs.1.nsurvexlegs|rjust:"10"|floatformat:"0g"}} {{legs.1.survexleglength|floatformat:"0g"}}{{legs.1.people|floatformat:"0g"}}{{legs.1.success|floatformat:"1g"}}

One Survex Survey Block is one *begin/*end block of data in a survex file. Some files from other caving clubs may have a convention of using many more blocks per file than we do, e.g. if the -file is exported from other software into survex format. +file is exported from other software into survex format, but each block is recroded on a single day. +

Currently the number of cavers includes non-caving attendees: that needs to be fixed.