Jump to content

Module talk:Sports table/Archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 05:47, 4 March 2020 (Archiving 1 discussion(s) from Module talk:Sports table) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Archive 1Archive 2

Again on some bugs I noted

Hi, I'm again here with some bugs/feature requests I would like to note. All of them are in my sandbox, but they can be summed up as two main problems:

  1. compatiblity and/or showing of bonus/penalty/starting points; and
  2. editable played/points columns.

For each problem I've presented a couple of examples of what I mean. Thanks. --Sannita - not just another it.wiki sysop 15:09, 28 November 2019 (UTC)

  1. Example 1 : Use |bonus_header= and |show_bonus_points=. I reckon this is to blame for example 2  : local s_pts = tonumber(Args['adjust_points_'..team_code_ii]) or tonumber(Args['startpoints_'..team_code_ii]) or 0 : it will use adjust_points then startpoints then 0 rather than adding them together. If there are bonus points and penalties require separate columns then this will require a further change. I've added them to your tables as an example. Spike 'em (talk) 15:26, 28 November 2019 (UTC)
    Spike 'em, thank you for identifying the bug. I have fixed this part. I would support having a |show_start_points=yes to have a separate starting points column. first, we should probably get an idea of how many pages are using both adjust_points and startpoints to make sure there are no surprises (now tracking in category:Pages using sports table with both adjust and startpoints). Frietjes (talk) 15:38, 28 November 2019 (UTC)
  2. You can hide the played column using |hide_played=yes, which I think is what you want for Example 2. In each case |only_pld_pts=yes not only hides the data columns, but also the result. If another usage of this parameter is needed then it would need more code changes. As to setting the played column to what you need, then I'd add the required number to the losses (can even enter it as "3+2" if you know there are 3 actual losses and 2 missing games) Spike 'em (talk) 16:26, 28 November 2019 (UTC)
Note: it is possible to set the Pld column directly using |matches_ABC= but these are only used if at least one of |win_ABC= |draw_ABC= or |loss_ABC= are blank or non-numeric. It would require a code change (a new table param?) to use this value to override the sum of W+D+L, even if all values are set. Something like
if yesno(Args['override_matches'] or 'no') or tonumber(Args['win_'..team_code_ii]) == nil or tonumber(Args['draw_'..team_code_ii]) == nil or tonumber(Args['loss_'..team_code_ii]) == nil then
Spike 'em (talk) 16:54, 28 November 2019 (UTC)
I possibly have not understood correctly the situation, if so, correct me. Is the situation is that there are 10 played games, but we (the editors) know only results for 8 of them, then to manually set it to 10 played games but add data only for 8? If so, then maybe just add another param |unknown_results= or something and then it will count W+D+L+Unknown and add a note to played cell explaining that there are missing results for x amount of games; possibly also adding the page to a tracking category. --Gonnym (talk) 17:35, 28 November 2019 (UTC)
That is my understanding : we know the final games played and points totals, and some (but not all) of the individual results. I think on the given Example 1 we can work out the full WDL record for each team (ARS must have beaten SIR at home, and SIR drew one and lost one against SCL), but I guess that is beside the point. Spike 'em (talk) 10:11, 29 November 2019 (UTC)
@Spike 'em and Frietjes: thank you for your answers, and sorry for being this late in answering - other things took over, as always...
About the bonus/penalty/starting points, IMHO they should be treated as three different things, although I do not know how many cases there are of teams that get bonus points and penalty points. I think I found an example somewhere, but it's lost in my laptop's folder, and it might take a while to find it again.
About the |hide_played=, I did not know it existed, but it's interesting to know. :) TBH, I'd use |matches_ABC=, but in some way this should be used also when |win_ABC= |draw_ABC= or |loss_ABC= are not blank. Otherwise the |unknown_results= proposal is also good.
Thank you again for your help! --Sannita - not just another it.wiki sysop 16:31, 3 December 2019 (UTC)
we have Category:Pages using sports table with both adjust and startpoints to find pages using both adjust and start points. I don't see any articles in there, so we can definitely split the two without any problems. we will, however, need to be careful with any headers to make sure we don't mislabel anything. I don't entirely understand the need for |unknown_results_XYZ= since you can set the number of matches manually with |matches_XYZ=. yes, it is true that in order for that parameter to work you must have a non-numeric value in least one of the |win_XYZ=, |draw_XYZ=, and |loss_XYZ=. but, this makes sense since more than one of them must be unknown for the number of matches to be unknown. you simply put a ? or some marker after the value to have it considered as non-numeric (see this edit). I do see that the results column is always hidden if you have |only_pld_points=yes. I don't know the best user syntax for having all the Pld/W/D/L/GF/GA hidden but still having the points and results columns shown. come up with some good input syntax and I can certainly make it work in the module. Frietjes (talk) 17:30, 3 December 2019 (UTC)