diff --git a/core/views/statistics.py b/core/views/statistics.py index 512dd94..f3c5974 100644 --- a/core/views/statistics.py +++ b/core/views/statistics.py @@ -18,6 +18,9 @@ from troggle.parsers.people import GetPersonExpeditionNameLookup, foreign_friend the status of data inconsistencies. Also the wallets summary report. """ def legs_by_expo(expos): + """This depends rather deeply on precisely how the survex parser has selected what it records + from each survex file + """ legsbyexpo = [] addupsurvexlength = 0.0 addupsurvexlegs = 0 @@ -33,12 +36,13 @@ def legs_by_expo(expos): addupsurvexlength += survexleglength addupsurvexlegs += legsyear - expoers = PersonExpedition.objects.filter(expedition=expedition).count() + expoers = PersonExpedition.objects.filter(expedition=expedition, noncaver=False).count() if expoers > 0: success = survexleglength/expoers else: success = "" - legsbyexpo.append((expedition, {"success":success, "people": expoers, "nsurvexlegs": legsyear, "survexleglength": survexleglength})) + tourists = PersonExpedition.objects.filter(expedition=expedition, noncaver=True).count() + legsbyexpo.append((expedition, {"success":success, "people": expoers, "tourists": tourists, "nsurvexlegs": legsyear, "survexleglength": survexleglength})) legsbyexpo.reverse() return legsbyexpo, addupsurvexlegs, addupsurvexlength @@ -111,7 +115,7 @@ def svxfilewild(request, year=None): def stats(request): """Calculates number of survey blocks, the number of survey legs and the survey length for each year. - This is only underground survey legs, but includes ARGE as well as Expo survex files. + This is only underground survey legs, but includes "wild" as well as walleted survex files. """ statsDict = {} statsDict["caveCount"] = f"{Cave.objects.count():,}" @@ -121,14 +125,16 @@ def stats(request): #statsDict["expoCount"] = f"{Expedition.objects.count():,}" # incorrect as no expo in 76, 2020,21 n = int(current_expo()) - 1975 - 3 - statsDict["expoCount"] = f"{n:,}" # incorrect as no expo in 76, 2020,21 + statsDict["expoCount"] = f"{n:,}" expos = Expedition.objects.all() legsbyexpo, addupsurvexlegs, addupsurvexlength = legs_by_expo(expos) + adduplength = f"{addupsurvexlength/1000:.1f}" + adduplegs = f"{addupsurvexlegs:,}" renderDict = { **statsDict, - **{"addupsurvexlength": addupsurvexlength / 1000, "legsbyexpo": legsbyexpo, "nsurvexlegs": addupsurvexlegs, "year": current_expo()}, + **{"adduplength": adduplength, "legsbyexpo": legsbyexpo, "adduplegs": adduplegs, "year": current_expo()}, } # new syntax return render(request, "statistics.html", renderDict) diff --git a/templates/cave.html b/templates/cave.html index 3a13ffe..843ab1f 100644 --- a/templates/cave.html +++ b/templates/cave.html @@ -239,7 +239,7 @@ cave survex path '{{ cave.areacode }}/{% if cave.kataster_number %}{{cave.katast {% if cave.explorers %}
{{ cave.explorers|safe }}
-
[This is a fossil: it used to show whether the cave was explored by CUCC/expo or by another group, but that information is now available in the survex files recording the surveying, see the primary survex file.] +
[This field is a fossil: it used to show whether the cave was explored by CUCC/expo or by another group, but that information is now available in the survex files recording the surveying, see the primary survex file. However, some caves do not have any survex files, in which case this information is worth keeping.] {% endif %}
{% endif %} diff --git a/templates/entrance.html b/templates/entrance.html index 8794611..493a458 100644 --- a/templates/entrance.html +++ b/templates/entrance.html @@ -76,6 +76,6 @@ {% endif %} {% if entrance.explorers %}{{ expoCount }} expeditions: {{ personCount }} people, {{ caveCount }} caves, {{ walletsCount }} wallets and {{ logbookEntryCount }} logbook entries. -
Number of survey legs: {{nsurvexlegs}}
-Total length: {{addupsurvexlength|stringformat:".1f"}} km adding up the total for each year.
Number of survey legs: {{adduplegs}}
+Total length: {{adduplength}} km adding up the total for each year.
These lengths are from surveys which have been recorded in expo wallets. Non-expo surveys done by other clubs, and surveys -which have not been properly recorded -in an expo wallet are excluded. -
These are uncorrected tape lengths which include pitches and duplicates but exclude splays or surface-surveys. They are uncorrected -because they are lengths before any loop-closure corrections done by survex. -
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). +
These lengths are not authoritative. +
These are uncorrected tape lengths.They are uncorrected +because they are lengths before any loop-closure corrections done by survex and because they include duplicated surveys. These numbers include pitches but exclude splays or surface-surveys. -
Authoritative survey lengths for each cave are calculated using a script which uses the -loop-closure corrected lengths and is manually curated to exclude duplicate surveys of the same cave. The results are maintained +
Authoritative survey lengths for each cave, as explored by expo participants, are calculated using a script which +