Skip to content

Commit 685d25a

Browse files
committed
fix
1 parent 2654a25 commit 685d25a

File tree

9 files changed

+36
-13
lines changed

9 files changed

+36
-13
lines changed

_doc/conf.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
"sphinx_gallery.gen_gallery",
2020
"sphinx_issues",
2121
"sphinx_runpython.blocdefs.sphinx_exref_extension",
22+
"sphinx_runpython.blocdefs.sphinx_faqref_extension",
2223
"sphinx_runpython.blocdefs.sphinx_mathdef_extension",
2324
"sphinx_runpython.epkg",
2425
"sphinx_runpython.gdot",
2526
"sphinx_runpython.runpython",
27+
"sphinxcontrib.blockdiag",
2628
"matplotlib.sphinxext.plot_directive",
2729
]
2830

@@ -40,7 +42,7 @@
4042
source_suffix = ".rst"
4143
master_doc = "index"
4244
project = "mlstatpy"
43-
copyright = "2016-2024, Xavier Dupré"
45+
copyright = "2016-2025, Xavier Dupré"
4446
author = "Xavier Dupré"
4547
version = __version__
4648
release = __version__
@@ -50,14 +52,26 @@
5052
todo_include_todos = True
5153
nbsphinx_execute = "never"
5254

53-
html_theme = "pydata_sphinx_theme"
55+
html_theme = "furo"
5456
html_theme_path = ["_static"]
5557
html_theme_options = {}
5658
html_sourcelink_suffix = ""
5759
html_static_path = ["_static"]
5860

5961
issues_github_path = "sdpython/mlstatpy"
6062

63+
nbsphinx_prolog = """
64+
65+
.. _nbl-{{ env.doc2path(env.docname, base=None).replace("/", "-").split(".")[0] }}:
66+
67+
"""
68+
69+
nbsphinx_epilog = """
70+
----
71+
72+
`Notebook on github <https://github.com/sdpython/teachpyx/tree/main/_doc/{{ env.doc2path(env.docname, base=None) }}>`_
73+
"""
74+
6175
# The following is used by sphinx.ext.linkcode to provide links to github
6276
linkcode_resolve = make_linkcode_resolve(
6377
"mlstatpy",

_doc/sg_execution_times.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Computation times
88
=================
9-
**00:00.945** total execution time for 1 file **from all galleries**:
9+
**00:01.457** total execution time for 1 file **from all galleries**:
1010

1111
.. container::
1212

@@ -33,5 +33,5 @@ Computation times
3333
- Time
3434
- Mem (MB)
3535
* - :ref:`sphx_glr_auto_examples_plot_logistic_decision.py` (``examples/plot_logistic_decision.py``)
36-
- 00:00.945
36+
- 00:01.457
3737
- 0.0

mlstatpy/ext_test_case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def _local_loop(ur):
139139
raise e
140140

141141
if chunk is None:
142-
if len(res) >= 2 and res[:2] == b"\x1f\x8B":
142+
if len(res) >= 2 and res[:2] == b"\x1f\x8b":
143143
# gzip format
144144
res = gzip.decompress(res)
145145

@@ -753,7 +753,7 @@ def ungzip_files(
753753
is_file = True
754754

755755
if encoding is None:
756-
f = gzip.open(filename, "rb")
756+
f = gzip.open(filename, "rb") # noqa: SIM115
757757
content = f.read()
758758
f.close()
759759
if unzip:
@@ -769,7 +769,7 @@ def ungzip_files(
769769
return filename
770770
return content
771771
else:
772-
f = gzip.open(filename, "rt", encoding="utf-8")
772+
f = gzip.open(filename, "rt", encoding="utf-8") # noqa: SIM115
773773
content = f.read()
774774
f.close()
775775
if is_file:

mlstatpy/graph/graph_distance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44

55
class _Vertex:
6-
__slots__ = ("nb", "label", "weight")
6+
__slots__ = ("nb", "label", "weight") # noqa: RUF023
77

88
def __init__(self, nb, label, weight):
99
self.nb = nb # kind of id
@@ -62,7 +62,7 @@ def Label(self):
6262

6363

6464
class _Edge:
65-
__slots__ = ("from_", "to", "label", "weight", "nb")
65+
__slots__ = ("from_", "to", "label", "weight", "nb") # noqa: RUF023
6666

6767
def __init__(self, from_, to, label, weight):
6868
self.from_, self.to = from_, to

mlstatpy/image/detection_segment/detection_nfa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class InformationPoint:
3434
proche du vecteur normal au segment (aligne)"""
3535

3636
# voir la classe Point pour __slots__
37-
__slots__ = "pos", "aligne", "norme"
37+
__slots__ = ("pos", "aligne", "norme") # noqa: RUF023
3838

3939
def __init__(self, pos, aligne, norme):
4040
"""constructeur, initialisation"""

mlstatpy/image/detection_segment/detection_segment_segangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SegmentBord(SegmentBord_Commun):
2828
"""
2929

3030
# voir la remarque de la classe Point a propos de __slots__
31-
__slots__ = "angle", "fin", "vecteur", "bord1", "dangle"
31+
__slots__ = ("angle", "fin", "vecteur", "bord1", "dangle") # noqa: RUF023
3232

3333
def __init__(self, dim, dangle=math.pi / 24.0):
3434
"""initialise les dimensions et

mlstatpy/nlp/completion.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ class CompletionTrieNode:
1010
It should be done another way (:epkg:`cython`, :epkg:`C++`).
1111
"""
1212

13-
__slots__ = ("value", "children", "weight", "leave", "stat", "parent", "disp")
13+
__slots__ = ( # noqa: RUF023
14+
"value",
15+
"children",
16+
"weight",
17+
"leave",
18+
"stat",
19+
"parent",
20+
"disp",
21+
)
1422

1523
def __init__(self, value, leave, weight=1.0, disp=None):
1624
"""

mlstatpy/nlp/completion_simple.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CompletionElement:
2626
:param disp: original string, use this to identify the node
2727
"""
2828

29-
__slots__ = (
29+
__slots__ = ( # noqa: RUF023
3030
"value",
3131
"weight",
3232
"disp",

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ select = [
8686
]
8787
"_unittests/**" = ["SIM113", "RUF005", "E402"]
8888
"**/plot*.py" = ["B018"]
89+
"_doc/conf.py" = ["E501"]
8990
"_doc/sphinxdoc/source/conf.py" = ["F821"]
9091
"_doc/notebooks/dsgarden/**" = ["B007", "E402"]
9192
"_doc/notebooks/metric/**" = ["C400", "RUF005", "B007", "C417"]

0 commit comments

Comments
 (0)