modernize some Python code
Since we now require Python 3.6, we can use f-strings instead of format() to make the code more readable. * doc/org/tut01.org, doc/org/tut02.org, doc/org/tut03.org, doc/org/tut21.org, doc/org/tut24.org, doc/org/tut90.org, python/spot/__init__.py, python/spot/jupyter.py, tests/python/acc.py, tests/python/acc_cond.ipynb, tests/python/complement_semidet.py, tests/python/decompose.ipynb, tests/python/formulas.ipynb, tests/python/highlighting.ipynb, tests/python/ipnbdoctest.py, tests/python/ltlf.py, tests/python/parity.ipynb, tests/python/product.ipynb, tests/python/relabel.py, tests/python/satmin.ipynb, tests/python/stutter-inv.ipynb, tests/python/twagraph-internals.ipynb, tests/python/zlktree.ipynb: Use f-strings.
This commit is contained in:
parent
df44f7a5c2
commit
7ac570fa3f
23 changed files with 292 additions and 327 deletions
|
|
@ -450,7 +450,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1ce910> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04240> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 3,
|
||||
|
|
@ -799,7 +799,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1ce430> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21e17b0c0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 4,
|
||||
|
|
@ -1244,7 +1244,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1ce940> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04090> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 5,
|
||||
|
|
@ -1676,7 +1676,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cefa0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04c00> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 6,
|
||||
|
|
@ -1938,7 +1938,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cee80> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04cf0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
|
|
@ -2255,7 +2255,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cec40> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04a50> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 8,
|
||||
|
|
@ -2546,7 +2546,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cebb0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04870> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
|
|
@ -2618,9 +2618,9 @@
|
|||
" <td>NaN</td>\n",
|
||||
" <td>996</td>\n",
|
||||
" <td>48806</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
|
|
@ -2633,7 +2633,7 @@
|
|||
" <td>2760</td>\n",
|
||||
" <td>224707</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>5</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
|
|
@ -2646,9 +2646,9 @@
|
|||
" <td>32</td>\n",
|
||||
" <td>2008</td>\n",
|
||||
" <td>155020</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
|
|
@ -2662,9 +2662,9 @@
|
|||
"2 5 4 4 11 32 2008 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 48806 2 0 0 0 \n",
|
||||
"1 224707 5 0 5 0 \n",
|
||||
"2 155020 3 0 3 0 "
|
||||
"0 48806 1 0 1 0 \n",
|
||||
"1 224707 5 1 5 0 \n",
|
||||
"2 155020 4 0 2 0 "
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -2937,7 +2937,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5a370> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe208005380> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 10,
|
||||
|
|
@ -3005,10 +3005,10 @@
|
|||
" <td>NaN</td>\n",
|
||||
" <td>348</td>\n",
|
||||
" <td>15974</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
" <th>1</th>\n",
|
||||
|
|
@ -3021,7 +3021,7 @@
|
|||
" <td>73187</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
|
|
@ -3049,8 +3049,8 @@
|
|||
"2 2 4 4 11 32 616 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 15974 0 0 1 0 \n",
|
||||
"1 73187 2 0 1 0 \n",
|
||||
"0 15974 1 0 0 0 \n",
|
||||
"1 73187 2 0 0 0 \n",
|
||||
"2 37620 1 0 0 0 "
|
||||
]
|
||||
},
|
||||
|
|
@ -3324,7 +3324,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cf870> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21e11bc00> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 11,
|
||||
|
|
@ -3394,9 +3394,9 @@
|
|||
" <td>40</td>\n",
|
||||
" <td>2300</td>\n",
|
||||
" <td>288887</td>\n",
|
||||
" <td>8</td>\n",
|
||||
" <td>7</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>12</td>\n",
|
||||
" <td>8</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
|
|
@ -3438,7 +3438,7 @@
|
|||
"2 2 1 NaN NaN NaN 92 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 288887 8 0 12 0 \n",
|
||||
"0 288887 7 0 8 0 \n",
|
||||
"1 18569 1 0 0 0 \n",
|
||||
"2 2337 0 0 0 0 "
|
||||
]
|
||||
|
|
@ -3627,7 +3627,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cf960> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04d80> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 12,
|
||||
|
|
@ -3695,7 +3695,7 @@
|
|||
" <td>40</td>\n",
|
||||
" <td>2742</td>\n",
|
||||
" <td>173183</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>0</td>\n",
|
||||
|
|
@ -3711,7 +3711,7 @@
|
|||
" <td>45412</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
|
|
@ -3723,7 +3723,7 @@
|
|||
" <td>NaN</td>\n",
|
||||
" <td>363</td>\n",
|
||||
" <td>10496</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
|
|
@ -3739,9 +3739,9 @@
|
|||
"2 4 3 NaN NaN NaN 363 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 173183 4 0 2 0 \n",
|
||||
"1 45412 1 0 0 0 \n",
|
||||
"2 10496 1 0 0 0 "
|
||||
"0 173183 3 0 2 0 \n",
|
||||
"1 45412 1 0 1 0 \n",
|
||||
"2 10496 0 0 0 0 "
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -4006,7 +4006,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5b3c0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04690> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 13,
|
||||
|
|
@ -4117,7 +4117,7 @@
|
|||
" <td>173427</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
|
|
@ -4133,7 +4133,7 @@
|
|||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 173427 3 0 2 0 \n",
|
||||
"1 173427 0 0 0 0 \n",
|
||||
"2 173427 0 0 1 0 "
|
||||
"2 173427 0 0 0 0 "
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -4412,7 +4412,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5b600> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2080067f0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 14,
|
||||
|
|
@ -4484,7 +4484,7 @@
|
|||
" <td>173183</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
|
|
@ -4498,7 +4498,7 @@
|
|||
" <td>173279</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" <tr>\n",
|
||||
|
|
@ -4526,8 +4526,8 @@
|
|||
"2 4 3 NaN NaN NaN 2742 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 173183 4 0 2 0 \n",
|
||||
"1 173279 0 0 0 0 \n",
|
||||
"0 173183 4 0 1 0 \n",
|
||||
"1 173279 0 0 1 0 \n",
|
||||
"2 173327 0 0 0 0 "
|
||||
]
|
||||
},
|
||||
|
|
@ -4807,7 +4807,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5bd50> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe208006c10> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 15,
|
||||
|
|
@ -5108,7 +5108,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5b6f0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe208006940> >"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -5159,7 +5159,7 @@
|
|||
" <td>40</td>\n",
|
||||
" <td>2742</td>\n",
|
||||
" <td>173183</td>\n",
|
||||
" <td>4</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>0</td>\n",
|
||||
|
|
@ -5176,7 +5176,7 @@
|
|||
" <td>173279</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>HOA: v1 States: 4 Start: 0 AP: 3 \"a\" \"c\" \"b\" a...</td>\n",
|
||||
" </tr>\n",
|
||||
|
|
@ -5206,8 +5206,8 @@
|
|||
"2 4 3 NaN NaN NaN 2742 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \\\n",
|
||||
"0 173183 4 0 2 0 \n",
|
||||
"1 173279 0 0 0 0 \n",
|
||||
"0 173183 3 0 2 0 \n",
|
||||
"1 173279 0 0 1 0 \n",
|
||||
"2 173327 0 0 0 0 \n",
|
||||
"\n",
|
||||
" automaton \n",
|
||||
|
|
@ -5544,7 +5544,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de94660> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe208007030> >"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -5830,7 +5830,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de946f0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe208006fa0> >"
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -5840,7 +5840,7 @@
|
|||
"source": [
|
||||
"for line, data in log.iterrows():\n",
|
||||
" if type(data.automaton) is str:\n",
|
||||
" print(\"automaton from line {}:\".format(line))\n",
|
||||
" print(f\"automaton from line {line}:\")\n",
|
||||
" display(spot.automaton(data.automaton + \"\\n\"))"
|
||||
]
|
||||
},
|
||||
|
|
@ -6261,7 +6261,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cefa0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd04c00> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 18,
|
||||
|
|
@ -6329,7 +6329,7 @@
|
|||
" <td>NaN</td>\n",
|
||||
" <td>687</td>\n",
|
||||
" <td>21896</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
|
|
@ -6343,9 +6343,9 @@
|
|||
" <td>32</td>\n",
|
||||
" <td>1905</td>\n",
|
||||
" <td>100457</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>3</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>2</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
|
|
@ -6358,8 +6358,8 @@
|
|||
"1 6 5 4 12 32 1905 \n",
|
||||
"\n",
|
||||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 21896 1 0 0 0 \n",
|
||||
"1 100457 2 0 2 0 "
|
||||
"0 21896 0 0 0 0 \n",
|
||||
"1 100457 3 0 1 0 "
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -6638,7 +6638,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f61ac1cf6c0> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe21cd051d0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 19,
|
||||
|
|
@ -6730,7 +6730,7 @@
|
|||
" <td>10496</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" <td>1</td>\n",
|
||||
" <td>0</td>\n",
|
||||
" </tr>\n",
|
||||
" </tbody>\n",
|
||||
|
|
@ -6746,7 +6746,7 @@
|
|||
" clauses enc.user enc.sys sat.user sat.sys \n",
|
||||
"0 51612 1 0 1 0 \n",
|
||||
"1 3129 0 0 0 0 \n",
|
||||
"2 10496 0 0 0 0 "
|
||||
"2 10496 0 0 1 0 "
|
||||
]
|
||||
},
|
||||
"metadata": {},
|
||||
|
|
@ -7025,7 +7025,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5b960> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe208006fa0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 20,
|
||||
|
|
@ -7581,7 +7581,7 @@
|
|||
"</svg>\n"
|
||||
],
|
||||
"text/plain": [
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7f611de5b570> >"
|
||||
"<spot.twa_graph; proxy of <Swig Object of type 'std::shared_ptr< spot::twa_graph > *' at 0x7fe2080074e0> >"
|
||||
]
|
||||
},
|
||||
"execution_count": 21,
|
||||
|
|
@ -7610,7 +7610,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.11.7"
|
||||
"version": "3.11.8"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue