Module talk:Sports table/Archive 2
![]() | This is an archive of past discussions about Module:Sports table. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 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:
- compatiblity and/or showing of bonus/penalty/starting points; and
- 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)
- 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)
- Spike 'em, thank you for identifying the bug. I have fixed this part. I would support having a
- 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 likeSpike 'em (talk) 16:54, 28 November 2019 (UTC)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
- 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)
- 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
- Example 1 : Use
- @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)
- 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
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 | ![]() |
3 | 3 | 0 | 0 | 10 | 5 | +5 | 9 |
Pos | Team | Pld | W | OTW | OTL | L | GF | GA | GD | Pts |
---|---|---|---|---|---|---|---|---|---|---|
1 | ![]() |
3 | 3 | 0 | 0 | 0 | 22 | 7 | +15 | 9 |
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)
- 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 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)
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)
Volleyball
@McVahl, Mohsen1248, and Voncabriga: after some discussion on my talk page, I have added alternative syntax to Module:Sports table/Volleyball that is similar to the input format used in {{Vb cl9 team}}
. Note that you probably only want to use on input style at a time, but if you do try to use more than one input style, the results should be additive. after my changes, the following should be roughly equivalent
{{Vb cl3 header}}
{{Vb cl9 team |p=1 |t={{vb|SRI}} |w3_0=3 |w3_1=0 |w3_2=0 |l2_3=0 |l1_3=0 |l0_3=0 |spw=225 |spl=158 |bc=#ccffcc}}
{{Vb cl9 team |p=2 |t={{vb|AUS}} |w3_0=0 |w3_1=1 |w3_2=1 |l2_3=0 |l1_3=0 |l0_3=1 |spw=256 |spl=269 |bc=#ccffcc}}
{{Vb cl9 team |p=3 |t={{vb|KSA}} |w3_0=0 |w3_1=1 |w3_2=0 |l2_3=0 |l1_3=1 |l0_3=1 |spw=243 |spl=254 |bc=#ffcccc}}
{{Vb cl9 team |p=4 |t={{vb|KAZ}} |w3_0=0 |w3_1=0 |w3_2=0 |l2_3=1 |l1_3=1 |l0_3=1 |spw=233 |spl=276 |bc=#ffcccc}}
{{end}}
|
{{#invoke:Sports table|main|style=Volleyball
|team1=SRI|name_SRI={{vb|SRI}} |win3s_SRI=3 |win4s_SRI=0 |win5s_SRI=0 |loss5s_SRI=0 |loss4s_SRI=0 |loss3s_SRI=0 |spw_SRI=225 |spl_SRI=158
|team2=AUS|name_AUS={{vb|AUS}} |win3s_AUS=0 |win4s_AUS=1 |win5s_AUS=1 |loss5s_AUS=0 |loss4s_AUS=0 |loss3s_AUS=1 |spw_AUS=256 |spl_AUS=269
|team3=KSA|name_KSA={{vb|KSA}} |win3s_KSA=0 |win4s_KSA=1 |win5s_KSA=0 |loss5s_KSA=0 |loss4s_KSA=1 |loss3s_KSA=1 |spw_KSA=243 |spl_KSA=254
|team4=KAZ|name_KAZ={{vb|KAZ}} |win3s_KAZ=0 |win4s_KAZ=0 |win5s_KAZ=0 |loss5s_KAZ=1 |loss4s_KAZ=1 |loss3s_KAZ=1 |spw_KAZ=233 |spl_KAZ=276
|col_A=#ccffcc|result1=A|result2=A
|col_E=#ffcccc|result3=E|result4=E
}}
|
note that win3s
means win in 3 sets, which is the same as w3_0
in the old vb templates. any win by more than one set is a "big win", and any loss by more than one set is a "big loss". the point values for big wins and big losses are the same as before and can be changed the same as before. let me know if you see any problems. Frietjes (talk) 21:14, 6 February 2020 (UTC)
Legs parameter from Module:Sports results
When the matches are defined in the template, would it be possible to support additional legs (for 3+ meetings in a season) as is done in Module:Sports results? For example here, so the results table doesn't have to be separate. S.A. Julio (talk) 23:15, 24 January 2020 (UTC)
- Can't you use {{ThreeLegStart}}? It has an option to extend it to five legs. Howard the Duck (talk) 13:48, 25 January 2020 (UTC)
- Doesn't really fit, as this isn't based on aggregate score or winning more matches than the other, but finishing first in a table based on points and goal difference. S.A. Julio (talk) 14:06, 25 January 2020 (UTC)
- S.A. Julio, probably works now, but let me know if I didn't implement it correctly. Frietjes (talk) 19:27, 26 January 2020 (UTC)
- Frietjes, great thanks! Only difference I noticed is the null value doesn't work for leg 3 (just displays a normal blank cell). S.A. Julio (talk) 03:11, 27 January 2020 (UTC)
- S.A. Julio, probably works now, but let me know if I didn't implement it correctly. Frietjes (talk) 19:27, 26 January 2020 (UTC)
- Doesn't really fit, as this isn't based on aggregate score or winning more matches than the other, but finishing first in a table based on points and goal difference. S.A. Julio (talk) 14:06, 25 January 2020 (UTC)
S.A. Julio, I think you are talking about the difference in the match3_BBB_AAA cell (which is omitted and not set to null) seen here
Pos | Team | Pld | W | D | L | GF | GA | GD | Pts | AAA | BBB | AAA | BBB | AAA | BBB | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Team A | 4 | 3 | 0 | 1 | 8 | 4 | +4 | 9 | 0–1 | 3–1 | |||||
2 | Team B | 4 | 1 | 0 | 3 | 4 | 8 | −4 | 6 | 2–3 | 0–2 | [a] |
Rules for classification: 1) points; 2) head-to-head points; 3) head-to-head goal difference; 4) head-to-head goals scored; 5) goal difference; 6) number of goals scored.
Notes:
- ^ Match not played
the interesting thing about this is that if you check the standard 1 leg case you see the same thing. the source of this difference can be found by checking the code for Module:Sports results line 184 which has Args[m..team_code_ii..'_'..team_code_jj] = (Args[m..team_code_ii..'_'..team_code_jj] or '–')..note_string
which is default dash and Module:Sports table line 472 which has Args[m..team_code_ii..'_'..team_code_jj] = (Args[m..team_code_ii..'_'..team_code_jj] or '')..note_string
which has default blank. another interesting feature is that if you were try to put a null in that cell you don't get what you would expect:
Pos | Team | Pld | W | D | L | GF | GA | GD | Pts | AAA | BBB | AAA | BBB | AAA | BBB | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Team A | 4 | 3 | 0 | 1 | 8 | 4 | +4 | 9 | 0–1 | 3–1 | |||||
2 | Team B | 4 | 1 | 0 | 3 | 4 | 8 | −4 | 6 | 2–3 | 0–2 | null[a] |
Rules for classification: 1) points; 2) head-to-head points; 3) head-to-head goal difference; 4) head-to-head goals scored; 5) goal difference; 6) number of goals scored.
Notes:
- ^ Match not played
unless you remove the note from the result. editors have probably figured this out by now. as far as the inconsistency goes, I am all for making them consistent. if possible, I would like to merge more of the redundant code which would force them to be consistent. the main question is: should the default be dash or should the default be blank? I really don't care either way. Frietjes (talk) 16:16, 27 January 2020 (UTC)
- Frietjes, thanks a lot for adding the legs functionality to this module. I have tried to add it to the Dutch version as well but weirdly it doesn't work there. nl:Sjabloon:Stand Play-off 3 (voetbal België) is one of the instance where its use is desired there. Could you take a look?Tvx1 21:18, 22 February 2020 (UTC)
- Tvx1, okay, I think I fixed it. there is a lot there, but you had missed making changes to the header and row subfunctions in nl:Module:Sports results. now that I have implemented the changes there, it should be working (although I may have missed something). Frietjes (talk) 14:45, 23 February 2020 (UTC)
I've been thinking about this a bit more and I'm starting to wonder why these legs are always generated in pairs (e.g. 2/4/6). In the above example, for instance, I'd think that the sixth column of matches doesn't really need to be there.Tvx1 22:39, 29 February 2020 (UTC)
Head to head column
I have been using the WDL template. In sports that frequently have multiple teams/players tied, it might be more useful to have a separate column for HTH rather than attaching notes to the points column. A hacky way that I have done this is to use
|rw_header=<abbr title="head-to-head score among tied players">HTH</abbr> |show_rw=yes |rwpoints=0
with |rw_NAME=1 (or however many points NAME had among tied teams/players)
This runs into problems though, especially if |rwpoints=0 gets removed in someone else's edit.
Is there a way someone could make an option for a hth column that appears right after the points column? Thanks!
The main reason I want one is for Chess tournaments. There is a Chess version of Sports table, but I'm not sure how it works exactly. At least, you can't just convert a WDL table into one, which would be kinda necessary. NHammen (talk) 13:49, 23 March 2020 (UTC)
I decided to make one in the sandbox for WDL myself. Testing testing:
Rank | Player | Pts | Pld | W | D | L | SB | NEP | MVL | CAR | GIR | WAN | GRI | DIN | ALE | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ![]() |
4.5 | 6 | 3 | 3 | 0 | 12 | — | ½ | 1 | 1 | ½ | 1 | ½ | ||
2 | ![]() |
3.5 | 6 | 1 | 5 | 0 | 9 | — | ½ | ½ | ½ | ½ | 1 | ½ | ||
3 | ![]() |
3 | 6 | 1 | 4 | 1 | 9 | ½ | ½ | — | ½ | ½ | 0 | 1 | ||
4–5 | ![]() |
3 | 6 | 1 | 4 | 1 | 7.75 | 0 | ½ | ½ | — | ½ | ½ | 1 | ||
4–5 | ![]() |
3 | 6 | 1 | 4 | 1 | 7.75 | 0 | ½ | ½ | — | ½ | 1 | ½ | ||
6 | ![]() |
3 | 6 | 0 | 6 | 0 | 9 | ½ | ½ | ½ | ½ | — | ½ | ½ | ||
7 | ![]() |
2 | 6 | 1 | 2 | 3 | 6 | 0 | 0 | 1 | ½ | 0 | ½ | — | ||
8 | ![]() |
2 | 6 | 0 | 4 | 2 | 7 | ½ | ½ | 0 | 0 | ½ | ½ | — |
Rules for classification: 1) points; 2) head-to-head score among tied players; 3) total number of wins; 4) Sonneborn–Berger score (SB); 5) tie-break games.
Note: Numbers in the crosstable in a white background indicate the result playing the respective opponent with the white pieces (black pieces if on a black background).
Seems to work. How does this get moved from sandbox to main? NHammen (talk) 20:16, 23 March 2020 (UTC)
- Nevermind. I got the Chess module table to work. So I don't need this to migrate from sandbox anymore. NHammen (talk) 00:31, 5 April 2020 (UTC)
Chess style match table
@Frietjes: In the chess style, I would like to make the match table look like the match table from the 2014 candidates tournament (copied below). However, the match table is called from Sports table main, not from the Chess style, so an alteration would have to be made to Sports table main. Would it be acceptable to make a copy of Module:Sports_results called Module:Sports_results/Chess which would only include the necessary functions (header and row I think) so that we could reverse the order of the team and leg loops in that module? In Sports table we would also need to add a line of code after
local p_matches = match_table and require('Module:Sports results')
that says
if style_def == 'Chess' then local p_matches = match_table and require('Module:Sports results/Chess') end
.
Is that too hacky?
Alternatively, we could add an option in Sports results which flips the order of the team and leg loops, but that would involve duplicating a lot of code in ways that it is easy to break things.
Anyways, I would like the match crosstable to end up looking something like this:
Final standings of the 2014 Candidates Tournament Rank Player Rating
March 20141
(VA)2
(SK)3
(VK)4
(SM)5
(DA)6
(LA)7
(PS)8
(VT)Points Tiebreaks H2H Wins SB W B W B W B W B W B W B W B W B 1 Viswanathan Anand
2770 ½ ½ ½ ½ ½ 1 ½ ½ 1 ½ ½ ½ 1 ½ 8½ — 3 57.25 2 Sergey Karjakin
2766 ½ ½ 1 0 ½ ½ ½ ½ 0 1 ½ 1 ½ ½ 7½ — 3 51.75 3 Vladimir Kramnik
2787 ½ ½ 1 0 1 ½ ½ ½ ½ ½ 0 ½ 1 0 7 2½ 3 49.25 4 Shakhriyar Mamedyarov
2757 0 ½ ½ ½ ½ 0 1 ½ 1 0 1 ½ ½ ½ 7 2 3 48.00 5 Dmitry Andreikin
2709 ½ ½ ½ ½ ½ ½ ½ 0 1 ½ ½ 0 1 ½ 7 1½ 2 48.50 6 Levon Aronian
2830 ½ 0 0 1 ½ ½ 1 0 ½ 0 1 ½ ½ ½ 6½ 1½ 3 45.00 7 Peter Svidler
2758 ½ ½ 0 ½ ½ 1 ½ 0 1 ½ ½ 0 1 0 6½ ½ 3 46.00 8 Veselin Topalov
2785 ½ 0 ½ ½ 1 0 ½ ½ ½ 0 ½ ½ 1 0 6 — 2 42.25
NHammen (talk) 20:49, 5 April 2020 (UTC)
@Frietjes: @CaradhrasAiguo: @Adpete: I built a Module:Sports results/Chess , and now I have some code in the sandbox. Here is the result:
Rank | Player | Rating March 2014 |
Score | H2H | Wins | SB | Qualification | VA | SK | VK | SM | DA | LA | PS | VT | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | ![]() |
2770 | 8 1⁄2 | — | 3 | 57.25 | Advance to title match | ½ | ½ | ½ | ½ | ½ | 1 | ½ | ½ | 1 | ½ | ½ | ½ | 1 | ½ | |||
2 | ![]() |
2766 | 7 1⁄2 | — | 3 | 51.75 | ½ | ½ | 1 | 0 | ½ | ½ | ½ | ½ | 0 | 1 | ½ | 1 | ½ | ½ | ||||
3 | ![]() |
2787 | 7 | 2 1⁄2 | 3 | 49.25 | ½ | ½ | 1 | 0 | 1 | ½ | ½ | ½ | ½ | ½ | 0 | ½ | 1 | 0 | ||||
4 | ![]() |
2757 | 7 | 2 | 3 | 48 | 0 | ½ | ½ | ½ | ½ | 0 | 1 | ½ | 1 | 0 | 1 | ½ | ½ | ½ | ||||
5 | ![]() |
2709 | 7 | 1 1⁄2 | 2 | 48.5 | ½ | ½ | ½ | ½ | ½ | ½ | ½ | 0 | 1 | ½ | ½ | 0 | 1 | ½ | ||||
6 | ![]() |
2830 | 6 1⁄2 | 1 1⁄2 | 3 | 45 | ½ | 0 | 0 | 1 | ½ | ½ | 1 | 0 | ½ | 0 | 1 | ½ | ½ | ½ | ||||
7 | ![]() |
2758 | 6 1⁄2 | 1⁄2 | 3 | 46 | ½ | ½ | 0 | ½ | ½ | 1 | ½ | 0 | 1 | ½ | ½ | 0 | 1 | 0 | ||||
8 | ![]() |
2785 | 6 | — | 2 | 42.25 | ½ | 0 | ½ | ½ | 1 | 0 | ½ | ½ | ½ | 0 | ½ | ½ | 1 | 0 |
For this to work, now all that needs to be done is that the 3 lines of code from Module:Sports table/sandbox need to be ported to the main Module:Sports table NHammen (talk) 01:02, 7 April 2020 (UTC)
- You seem to have changed a lot more than 3 lines, is it just the section at the top that you need changing? Spike 'em (talk) 09:12, 7 April 2020 (UTC)
- @Spike 'em: The diff (https://en.wikipedia.org/w/index.php?title=Special%3AComparePages&page1=Module%3ASports+table&page2=Module%3ASports+table%2Fsandbox) between the current Sports table and the Sports table/sandbox has five lines of code that are different. Two of those differences are just using the sandbox versions of other modules, which have no differences from their main. The other three lines of code are the lines that I added. NHammen (talk) 13:11, 7 April 2020 (UTC)
- Ah, apologies: I was just diffing the recent changes you made to the sandbox, some of which was just getting that in-line with the main page. Spike 'em (talk) 14:02, 7 April 2020 (UTC)
- No need to apologize. That's entirely understandable. NHammen (talk) 15:45, 7 April 2020 (UTC)
- NHammen, I made this change which should be effectively what you had, but without the extra require. if we have a situation where there are more sports that have custom results tables, we can always refactor the code to use the equivalent of a "switch" statement there. hopefully I didn't break anything. the main reason why I stopped working on the chess submodule was lack of interest from the community. it seems like you will have more luck than I did. Frietjes (talk) 15:45, 8 April 2020 (UTC)
- Frietjes, thank you. That works great! NHammen (talk) 17:51, 8 April 2020 (UTC)
- NHammen, I made this change which should be effectively what you had, but without the extra require. if we have a situation where there are more sports that have custom results tables, we can always refactor the code to use the equivalent of a "switch" statement there. hopefully I didn't break anything. the main reason why I stopped working on the chess submodule was lack of interest from the community. it seems like you will have more luck than I did. Frietjes (talk) 15:45, 8 April 2020 (UTC)
- No need to apologize. That's entirely understandable. NHammen (talk) 15:45, 7 April 2020 (UTC)
- Ah, apologies: I was just diffing the recent changes you made to the sandbox, some of which was just getting that in-line with the main page. Spike 'em (talk) 14:02, 7 April 2020 (UTC)
- @Spike 'em: The diff (https://en.wikipedia.org/w/index.php?title=Special%3AComparePages&page1=Module%3ASports+table&page2=Module%3ASports+table%2Fsandbox) between the current Sports table and the Sports table/sandbox has five lines of code that are different. Two of those differences are just using the sandbox versions of other modules, which have no differences from their main. The other three lines of code are the lines that I added. NHammen (talk) 13:11, 7 April 2020 (UTC)
Possible unclosed span tag error
This module appears to be causing unclosed span style="white-space:nowrap"
tags in the formatted |teamn=
table cell. You can see it if you copy the Group A table from 2014 FIFA World Cup qualification – AFC Third Round into Special:ExpandTemplates. Is it possible to close these span tags? Thanks. – Jonesey95 (talk) 15:01, 11 April 2020 (UTC)
- I see them. These tags come from the column header for the match results table. This is handled by Module:Sports results, which is called from this module. This problem almost certainly arises from the get_short_name function in that module. Unfortunately, there is some rather complex gsub stuff going on there, which seems to be the source of the problem. One solution is to explicitly define
|short_TTT=
yourself, so that the meat of the get_short_name function is not called. But this is just hiding the fact that there is an error somewhere in this function. NHammen (talk) 20:07, 12 April 2020 (UTC)
@Jonesey95:I see the problem. The command n = mw.ustring.gsub(n, '(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%][^<>]*</span>).*', '%1')
removes everything after the closing span for the <span class="flagicon">
. But at the point it is called in this example, the only thing after that closing span is the closing span for the <span style="white-space:nowrap">
. I am hesitant to remove that line of code, because it must be there for a reason. Maybe it should strip everything before the <span class="flagicon">
as well? So that would be n = mw.ustring.gsub(n, '.*(<span class="flagicon">%s*%[%[[Ff][Ii][Ll][Ee]:[^%[%]]*%]%][^<>]*</span>).*', '%1')
. NHammen (talk) 20:24, 12 April 2020 (UTC)
- @Frietjes: before I go into the sandbox to fix this issue, do you remember why the line of code in this diff (https://en.wikipedia.org/w/index.php?title=Module:Sports_results&diff=926327613&oldid=925509592) was added? I don't want to end up breaking something that you had fixed. NHammen (talk) 20:38, 12 April 2020 (UTC)
- So, I went into the sandbox, and my addition of 2 characters does fix the issue discussed here. Still need to check if it breaks something else. NHammen (talk) 21:21, 12 April 2020 (UTC)
- I copied over the sandbox. I think you understand the intent of that section of code (to remove everything but the flag in the abbreviation for the team name), so removing stuff before and/or after the flag would be correct. thank you! Frietjes (talk) 15:14, 13 April 2020 (UTC)
- That's what I figured. Just wanted to be sure, because this could potentially have large effects. And I think I am not so good with the gsub stuff yet. NHammen (talk) 15:56, 13 April 2020 (UTC)
- That looks good to me. Thanks! – Jonesey95 (talk) 19:38, 13 April 2020 (UTC)
- That's what I figured. Just wanted to be sure, because this could potentially have large effects. And I think I am not so good with the gsub stuff yet. NHammen (talk) 15:56, 13 April 2020 (UTC)
- I copied over the sandbox. I think you understand the intent of that section of code (to remove everything but the flag in the abbreviation for the team name), so removing stuff before and/or after the flag would be correct. thank you! Frietjes (talk) 15:14, 13 April 2020 (UTC)
- So, I went into the sandbox, and my addition of 2 characters does fix the issue discussed here. Still need to check if it breaks something else. NHammen (talk) 21:21, 12 April 2020 (UTC)
Average number of points per matches played
Necessary for Template:2019–20 Ligue 1 table as per final declared table of Ligue 1: [3]. Chanheigeorge (talk) 16:27, 30 April 2020 (UTC)
- In the WDL style, use
|ranking_style=ppg
for points per game NHammen (talk) 17:00, 30 April 2020 (UTC)