Repository: LMFDB/lmfdb

Issue:
Sorting by label
In 
  http://www.lmfdb.org/padicField/?n=8&p=2&c=18&hidecol=p.c.e.f.gal.slopes
the fields are helpfully sorted by label, but instead of 
  2.8.18.1, 2.8.18.2, ... 
it does
  2.8.18.1, 2.8.18.10, ...
(sorting the strings).  Note that sorting by label is not an option in the dropdown list--perhaps we could add that, since we using it to break ties.  But wouldn't it also make more sense to sort them in the first way?  (It would make my life easier, when I'm grabbing number 18 from the list, it's easier when that's in the 18th place.)  

I have a workaround, so this is low priority.
Sorting by label
In 
  http://www.lmfdb.org/padicField/?n=8&p=2&c=18&hidecol=p.c.e.f.gal.slopes
the fields are helpfully sorted by label, but instead of 
  2.8.18.1, 2.8.18.2, ... 
it does
  2.8.18.1, 2.8.18.10, ...
(sorting the strings).  Note that sorting by label is not an option in the dropdown list--perhaps we could add that, since we using it to break ties.  But wouldn't it also make more sense to sort them in the first way?  (It would make my life easier, when I'm grabbing number 18 from the list, it's easier when that's in the 18th place.)  

I have a workaround, so this is low priority.


Discussion:
Agreed, the default sort order should be lexicgraphic on the quadruple of integers (p,n,c,num) that make up the label.  We may need to add a column for num to achieve this (analogous to the column iso_num in nf_fields), but this would be easy to do, and once done we can make this the default sort order.
This was solved for Modular curves, but not for other parts of the LMFDB (including local fields).
Sorry my bad, Edgar linked to this issue in his remark about modular curve label sorting and I didn't actually check to see if it was about modular curves!
Agreed, the default sort order should be lexicgraphic on the quadruple of integers (p,n,c,num) that make up the label.  We may need to add a column for num to achieve this (analogous to the column iso_num in nf_fields), but this would be easy to do, and once done we can make this the default sort order.
This was solved for Modular curves, but not for other parts of the LMFDB (including local fields).
Sorry my bad, Edgar linked to this issue in his remark about modular curve label sorting and I didn't actually check to see if it was about modular curves!

Resolving patch:
diff --git a/lmfdb/local_fields/main.py b/lmfdb/local_fields/main.py
--- a/lmfdb/local_fields/main.py
+++ b/lmfdb/local_fields/main.py
@@ -587,15 +587,15 @@ def reliability():
 
 class LFSearchArray(SearchArray):
     noun = "field"
-    sorts = [("", "prime", ['p', 'n', 'c', 'label']),
-             ("n", "degree", ['n', 'p', 'c', 'label']),
-             ("c", "discriminant exponent", ['c', 'p', 'n', 'label']),
-             ("e", "ramification index", ['e', 'n', 'p', 'c', 'label']),
-             ("f", "residue degree", ['f', 'n', 'p', 'c', 'label']),
-             ("gal", "Galois group", ['n', 'galT', 'p', 'c', 'label']),
-             ("u", "Galois unramified degree", ['u', 'n', 'p', 'c', 'label']),
-             ("t", "Galois tame degree", ['t', 'n', 'p', 'c', 'label']),
-             ("s", "top slope", ['top_slope', 'p', 'n', 'c', 'label'])]
+    sorts = [("", "prime", ['p', 'n', 'c', 'num']),
+             ("n", "degree", ['n', 'p', 'c', 'num']),
+             ("c", "discriminant exponent", ['c', 'p', 'n', 'num']),
+             ("e", "ramification index", ['e', 'n', 'p', 'c', 'num']),
+             ("f", "residue degree", ['f', 'n', 'p', 'c', 'num']),
+             ("gal", "Galois group", ['n', 'galT', 'p', 'c', 'num']),
+             ("u", "Galois unramified degree", ['u', 'n', 'p', 'c', 'num']),
+             ("t", "Galois tame degree", ['t', 'n', 'p', 'c', 'num']),
+             ("s", "top slope", ['top_slope', 'p', 'n', 'c', 'num'])]
     jump_example = "2.4.6.7"
     jump_egspan = "e.g. 2.4.6.7"
     jump_knowl = "lf.search_input"


Test patch: