Skip to content

Commit f61db62

Browse files
committed
Link to function in documentation
1 parent f3a8515 commit f61db62

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

datastream/dataset.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ def from_subscriptable(subscriptable) -> Dataset:
6767
Create ``Dataset`` based on subscriptable i.e. implements
6868
``__get_item__``. Should only be used for simple examples as a
6969
``Dataset`` created with this method does not support methods that
70-
require a source dataframe (i.e. ``Dataset.split`` and
71-
``Dataset.subset``)
70+
require a source dataframe (i.e. :func:`Dataset.split` and
71+
:func:`Dataset.subset`)
7272
'''
7373
return (
7474
Dataset.from_dataframe(
@@ -284,7 +284,7 @@ def to_concat(dataset_index, inner_index):
284284
def concat(datasets: List[Dataset]) -> Dataset[R]:
285285
'''
286286
Concatenate multiple datasets together so that they behave like a
287-
single dataset. Consider using ``Datastream.merge`` if you have
287+
single dataset. Consider using :func:`Datastream.merge` if you have
288288
multiple data sources.
289289
'''
290290
from_concat_mapping = Dataset.create_from_concat_mapping(datasets)

datastream/datastream.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class Datastream(BaseModel, Generic[T]):
3333
``Datastream[T]`` combines a ``Dataset[T]`` and a sampler into a stream of
3434
examples. By default the samples are drawn without replacement until the
3535
full dataset is exhausted. The proportion of the dataset that should be
36-
drawn before allowing replacement can be changed with ``.sample_proportion``.
36+
drawn before allowing replacement can be changed with
37+
:func:`Datastream.sample_proportion`.
3738
3839
>>> from datastream import Dataset, Datastream
3940
>>> data_loader = (
@@ -176,7 +177,7 @@ def sample_proportion(
176177
proportion: float,
177178
) -> Datastream[T]:
178179
'''
179-
Create new ``Datastream`` with changed proportion. This changes the
180+
Create new ``Datastream[T]`` with changed proportion. This changes the
180181
numbers of drawn samples before restarting sampling with new weights
181182
and allowing sample replacement.
182183
@@ -195,7 +196,7 @@ def state_dict(self) -> Dict:
195196
return dict(sampler=self.sampler.state_dict())
196197

197198
def load_state_dict(self, state_dict: Dict):
198-
'''Load saved state from ``Datastream.state_dict``.'''
199+
'''Load saved state from :func:`Datastream.state_dict`.'''
199200
return self.sampler.load_state_dict(state_dict['sampler'])
200201

201202
def multi_sample(self: Datastream[T], n: int) -> Datastream[T]:

0 commit comments

Comments
 (0)