Skip to content

Commit 73dd50c

Browse files
committed
[doc][Python] Fix SyntaxWarning from invalid escape sequence in docstrings
1 parent 5db4729 commit 73dd50c

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

bindings/pyroot/pythonizations/python/ROOT/_pythonization/_ml_dataloader.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def __exit__(self, type, value, traceback):
518518

519519
# formatted iterator (returned by as_torch / as_numpy / as_tensorflow)
520520
class FormattedLoader:
521-
"""
521+
r"""
522522
\ingroup Py_ML
523523
Iterable that converts each batch to the requested format.
524524
Returned by the as_torch / as_numpy / as_tensorflow methods on RDataLoader.
@@ -550,7 +550,7 @@ def __iter__(self):
550550

551551

552552
class RDataLoader:
553-
"""
553+
r"""
554554
\ingroup Py_ML
555555
Entry point for ML batch loading from a ROOT RDataFrame.
556556
@@ -588,7 +588,7 @@ def __init__(
588588
sampling_ratio: float = 1.0,
589589
replacement: bool = False,
590590
) -> None:
591-
"""
591+
r"""
592592
\ingroup Py_ML
593593
594594
Args:
@@ -702,15 +702,15 @@ def train_test_split(self, test_size: float = 0.2) -> Tuple[RDataLoader, RDataLo
702702
)
703703

704704
def as_numpy(self) -> FormattedLoader:
705-
"""
705+
r"""
706706
\ingroup Py_ML
707707
Return an iterable that yields batches as NumPy arrays.
708708
"""
709709
self._ensure_created()
710710
return FormattedLoader(self._internal, self._internal.ConvertBatchToNumpy, self._is_training)
711711

712712
def as_torch(self, device: str | torch.device | None = None) -> FormattedLoader:
713-
"""
713+
r"""
714714
\ingroup Py_ML
715715
Return an iterable that yields batches as PyTorch tensors.
716716
@@ -722,7 +722,7 @@ def as_torch(self, device: str | torch.device | None = None) -> FormattedLoader:
722722
return FormattedLoader(self._internal, conversion_fn, self._is_training)
723723

724724
def as_tensorflow(self) -> tf.data.Dataset:
725-
"""
725+
r"""
726726
\ingroup Py_ML
727727
Return a tf.data.Dataset over batches as TensorFlow tensors.
728728
"""
@@ -758,7 +758,7 @@ def as_tensorflow(self) -> tf.data.Dataset:
758758

759759
@property
760760
def columns(self) -> list[str]:
761-
"""
761+
r"""
762762
\ingroup Py_ML
763763
All column names as they appear in each batch tensor.
764764
"""
@@ -768,7 +768,7 @@ def columns(self) -> list[str]:
768768

769769
@property
770770
def train_columns(self) -> list[str]:
771-
"""
771+
r"""
772772
\ingroup Py_ML
773773
Feature column names (columns minus target and weights).
774774
"""
@@ -780,7 +780,7 @@ def train_columns(self) -> list[str]:
780780

781781
@property
782782
def target_columns(self) -> list[str]:
783-
"""
783+
r"""
784784
\ingroup Py_ML
785785
Target column names.
786786
"""
@@ -790,7 +790,7 @@ def target_columns(self) -> list[str]:
790790

791791
@property
792792
def weights_column(self) -> str:
793-
"""
793+
r"""
794794
\ingroup Py_ML
795795
Weights column name, or empty string if not set.
796796
"""
@@ -800,7 +800,7 @@ def weights_column(self) -> str:
800800

801801
@property
802802
def num_batches(self) -> int:
803-
"""
803+
r"""
804804
\ingroup Py_ML
805805
Total number of batches in this split for one epoch.
806806
"""
@@ -815,7 +815,7 @@ def num_batches(self) -> int:
815815

816816
@property
817817
def last_batch_no_of_rows(self) -> int:
818-
"""
818+
r"""
819819
\ingroup Py_ML
820820
Number of rows in the last (remainder) batch, 0 if no remainder.
821821
"""

0 commit comments

Comments
 (0)