@@ -69,8 +69,8 @@ def test_tabular_hrules(styler):
69
69
def test_tabular_custom_hrules (styler ):
70
70
styler .set_table_styles (
71
71
[
72
- {"selector" : "toprule" , "props" : ":hline" },
73
- {"selector" : "bottomrule" , "props" : ":otherline" },
72
+ {"selector" : "toprule" , "props" : "value :hline" },
73
+ {"selector" : "bottomrule" , "props" : "value :otherline" },
74
74
]
75
75
) # no midrule
76
76
expected = dedent (
@@ -89,10 +89,10 @@ def test_tabular_custom_hrules(styler):
89
89
90
90
def test_column_format (styler ):
91
91
# default setting is already tested in `test_latex_minimal_tabular`
92
- styler .set_table_styles ([{"selector" : "column_format" , "props" : ":cccc" }])
92
+ styler .set_table_styles ([{"selector" : "column_format" , "props" : "value :cccc" }])
93
93
94
94
assert "\\ begin{tabular}{rrrr}" in styler .to_latex (column_format = "rrrr" )
95
- styler .set_table_styles ([{"selector" : "column_format" , "props" : ":r|r|cc" }])
95
+ styler .set_table_styles ([{"selector" : "column_format" , "props" : "value :r|r|cc" }])
96
96
assert "\\ begin{tabular}{r|r|cc}" in styler .to_latex ()
97
97
98
98
@@ -112,15 +112,15 @@ def test_siunitx_cols(styler):
112
112
def test_position (styler ):
113
113
assert "\\ begin{table}[h!]" in styler .to_latex (position = "h!" )
114
114
assert "\\ end{table}" in styler .to_latex (position = "h!" )
115
- styler .set_table_styles ([{"selector" : "position" , "props" : ":b!" }])
115
+ styler .set_table_styles ([{"selector" : "position" , "props" : "value :b!" }])
116
116
assert "\\ begin{table}[b!]" in styler .to_latex ()
117
117
assert "\\ end{table}" in styler .to_latex ()
118
118
119
119
120
120
@pytest .mark .parametrize ("env" , [None , "longtable" ])
121
121
def test_label (styler , env ):
122
122
assert "\n \\ label{text}" in styler .to_latex (label = "text" , environment = env )
123
- styler .set_table_styles ([{"selector" : "label" , "props" : ":{more §text}" }])
123
+ styler .set_table_styles ([{"selector" : "label" , "props" : "value :{more §text}" }])
124
124
assert "\n \\ label{more :text}" in styler .to_latex (environment = env )
125
125
126
126
@@ -159,8 +159,8 @@ def test_kwargs_combinations(
159
159
def test_custom_table_styles (styler ):
160
160
styler .set_table_styles (
161
161
[
162
- {"selector" : "mycommand" , "props" : ":{myoptions}" },
163
- {"selector" : "mycommand2" , "props" : ":{myoptions2}" },
162
+ {"selector" : "mycommand" , "props" : "value :{myoptions}" },
163
+ {"selector" : "mycommand2" , "props" : "value :{myoptions2}" },
164
164
]
165
165
)
166
166
expected = dedent (
@@ -410,14 +410,14 @@ def test_comprehensive(df_ext, environment):
410
410
stlr .set_caption ("mycap" )
411
411
stlr .set_table_styles (
412
412
[
413
- {"selector" : "label" , "props" : ":{fig§item}" },
414
- {"selector" : "position" , "props" : ":h!" },
415
- {"selector" : "position_float" , "props" : ":centering" },
416
- {"selector" : "column_format" , "props" : ":rlrlr" },
417
- {"selector" : "toprule" , "props" : ":toprule" },
418
- {"selector" : "midrule" , "props" : ":midrule" },
419
- {"selector" : "bottomrule" , "props" : ":bottomrule" },
420
- {"selector" : "rowcolors" , "props" : ":{3}{pink}{}" }, # custom command
413
+ {"selector" : "label" , "props" : "value :{fig§item}" },
414
+ {"selector" : "position" , "props" : "value :h!" },
415
+ {"selector" : "position_float" , "props" : "value :centering" },
416
+ {"selector" : "column_format" , "props" : "value :rlrlr" },
417
+ {"selector" : "toprule" , "props" : "value :toprule" },
418
+ {"selector" : "midrule" , "props" : "value :midrule" },
419
+ {"selector" : "bottomrule" , "props" : "value :bottomrule" },
420
+ {"selector" : "rowcolors" , "props" : "value :{3}{pink}{}" }, # custom command
421
421
]
422
422
)
423
423
stlr .highlight_max (axis = 0 , props = "textbf:--rwrap;cellcolor:[rgb]{1,1,0.6}--rwrap" )
@@ -511,17 +511,17 @@ def test_parse_latex_header_span():
511
511
def test_parse_latex_table_wrapping (styler ):
512
512
styler .set_table_styles (
513
513
[
514
- {"selector" : "toprule" , "props" : ":value" },
515
- {"selector" : "bottomrule" , "props" : ":value" },
516
- {"selector" : "midrule" , "props" : ":value" },
517
- {"selector" : "column_format" , "props" : ":value" },
514
+ {"selector" : "toprule" , "props" : "value :value" },
515
+ {"selector" : "bottomrule" , "props" : "value :value" },
516
+ {"selector" : "midrule" , "props" : "value :value" },
517
+ {"selector" : "column_format" , "props" : "value :value" },
518
518
]
519
519
)
520
520
assert _parse_latex_table_wrapping (styler .table_styles , styler .caption ) is False
521
521
assert _parse_latex_table_wrapping (styler .table_styles , "some caption" ) is True
522
522
styler .set_table_styles (
523
523
[
524
- {"selector" : "not-ignored" , "props" : ":value" },
524
+ {"selector" : "not-ignored" , "props" : "value :value" },
525
525
],
526
526
overwrite = False ,
527
527
)
0 commit comments