Module talk:Sports table/Archive 2

This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 06:09, 2 May 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.

Latest comment: 5 years ago by Gonnym in topic Abbreviation issue
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)

Hiding GF&GA columns

I have a table where the source only gives information on GD but not on GF or GA: [1]. Is there a way I can hide the GF and GA columns and only display the GD column? Chanheigeorge (talk) 23:00, 4 January 2020 (UTC)

Chanheigeorge, okay, |hide_for_against_columns=y should work now. Frietjes (talk) 16:33, 5 January 2020 (UTC)

Hockey

Hi, I'm using the template for different sports and I noticed width is different for Ice Hockey and other sports, is there any specific reason ? I think they should be all the same.

Pos Team Pld W D L GF GA GD Pts
1   Cameroon 3 3 0 0 10 5 +5 9
Source: [citation needed]
Pos Team Pld W OTW OTL L GF GA GD Pts
1   Cameroon 3 3 0 0 0 22 7 +15 9
Source: [citation needed]

Mohsen1248 (talk) 13:26, 5 January 2020 (UTC)

They have different columns due to different rules about draws (or lack of them). Do you have any pages which mix usage of these tables that are experiencing problems? Spike 'em (talk) 14:51, 5 January 2020 (UTC)
in addition, sometimes there are different point multipliers assigned for OTW/OTL vs PKW/PKL. Frietjes (talk) 16:34, 5 January 2020 (UTC)
I still can't understand why for example the "pos" column should be different in those two tables. I didn't say why they have different columns, obviously I know they are different sports, I mean why column width is different. why hockey tables are wider ? Mohsen1248 (talk) 17:36, 5 January 2020 (UTC)
WDL has a standard column width of 28, whereas WDL OT (which WL OT invokes) has 32. Each of these has been the same since the modules were first created in 2014 / 2016 respectively. As to why this was done you'd have to ask the module creators (though it maybe that the 3 letter column headings are too wide to fit in the 28 pixel columns, so all the columns were widened so that they are constant within a given table?) Spike 'em (talk) 21:41, 5 January 2020 (UTC)
I can see the reason but if the whole idea of creating this Module:Sports table is to standardize all sport tables then it should be the same as others. I think maybe they can only keep those two columns at "32 pixel" or maybe even make it OW and OL instead of OWL and OTL. Mohsen1248 (talk) 11:29, 7 January 2020 (UTC)

Abbreviation issue

The right-hand side of the tables at the Group A section 2015 Ken Galluccio Cup use abbreviations that aren't written anywhere else in the article. Not sure why the usage is even warranted, as there is certainly enough space to write it out in full (as MOS:ABBR says Always consider whether it is better to simply write a word or phrase out in full, thus avoiding potential confusion for those not familiar with its abbreviation. Remember that Wikipedia does not have the same space constraints as paper.), but even if it's desired, the abbreviations should use {{abbr}} as the left-side of the table does - consistent and less confusion for everyone. --Gonnym (talk) 07:33, 1 February 2020 (UTC)