-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Remove legacy Sphinx roles from docstrings #8016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1461,10 +1461,10 @@ def generate_from_dict(obj: Any): | |||||
|
|
||||||
| generate_from_dict is the recursive helper for Features.from_dict, and allows for a convenient constructor syntax | ||||||
| to define features from deserialized JSON dictionaries. This function is used in particular when deserializing | ||||||
| a :class:`DatasetInfo` that was dumped to a JSON object. This acts as an analogue to | ||||||
| :meth:`Features.from_arrow_schema` and handles the recursive field-by-field instantiation, but doesn't require any | ||||||
| a `DatasetInfo` that was dumped to a JSON object. This acts as an analogue to | ||||||
| `Features.from_arrow_schema` and handles the recursive field-by-field instantiation, but doesn't require any | ||||||
| mapping to/from pyarrow, except for the fact that it takes advantage of the mapping of pyarrow primitive dtypes | ||||||
| that :class:`Value` automatically performs. | ||||||
| that `Value` automatically performs. | ||||||
| """ | ||||||
| # Nested structures: we allow dict, list/tuples, sequences | ||||||
| if isinstance(obj, list): | ||||||
|
|
@@ -1665,10 +1665,10 @@ def require_decoding(feature: FeatureType, ignore_decode_attribute: bool = False | |||||
|
|
||||||
| Args: | ||||||
| feature (FeatureType): the feature type to be checked | ||||||
| ignore_decode_attribute (:obj:`bool`, default ``False``): Whether to ignore the current value | ||||||
| ignore_decode_attribute (`bool`, default ``False``): Whether to ignore the current value | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| of the `decode` attribute of the decodable feature types. | ||||||
| Returns: | ||||||
| :obj:`bool` | ||||||
| `bool` | ||||||
| """ | ||||||
| if isinstance(feature, dict): | ||||||
| return any(require_decoding(f) for f in feature.values()) | ||||||
|
|
@@ -1690,7 +1690,7 @@ def require_storage_cast(feature: FeatureType) -> bool: | |||||
| Args: | ||||||
| feature (FeatureType): the feature type to be checked | ||||||
| Returns: | ||||||
| :obj:`bool` | ||||||
| `bool` | ||||||
| """ | ||||||
| if isinstance(feature, dict): | ||||||
| return any(require_storage_cast(f) for f in feature.values()) | ||||||
|
|
@@ -1708,7 +1708,7 @@ def require_storage_embed(feature: FeatureType) -> bool: | |||||
| Args: | ||||||
| feature (FeatureType): the feature type to be checked | ||||||
| Returns: | ||||||
| :obj:`bool` | ||||||
| `bool` | ||||||
| """ | ||||||
| if isinstance(feature, dict): | ||||||
| return any(require_storage_cast(f) for f in feature.values()) | ||||||
|
|
@@ -1722,7 +1722,7 @@ def require_storage_embed(feature: FeatureType) -> bool: | |||||
|
|
||||||
| def keep_features_dicts_synced(func): | ||||||
| """ | ||||||
| Wrapper to keep the secondary dictionary, which tracks whether keys are decodable, of the :class:`datasets.Features` object | ||||||
| Wrapper to keep the secondary dictionary, which tracks whether keys are decodable, of the `datasets.Features` object | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use the
Suggested change
|
||||||
| in sync with the main dictionary. | ||||||
| """ | ||||||
|
|
||||||
|
|
@@ -1812,7 +1812,7 @@ def type(self): | |||||
| Features field types. | ||||||
|
|
||||||
| Returns: | ||||||
| :obj:`pyarrow.DataType` | ||||||
| `pyarrow.DataType` | ||||||
| """ | ||||||
| return get_nested_type(self) | ||||||
|
|
||||||
|
|
@@ -1822,7 +1822,7 @@ def arrow_schema(self): | |||||
| Features schema. | ||||||
|
|
||||||
| Returns: | ||||||
| :obj:`pyarrow.Schema` | ||||||
| `pyarrow.Schema` | ||||||
| """ | ||||||
| hf_metadata = {"info": {"features": self.to_dict()}} | ||||||
| return pa.schema(self.type).with_metadata({"huggingface": json.dumps(hf_metadata)}) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,10 +27,10 @@ def __init__( | |||||
| without the compression extension at the end of the filename. | ||||||
|
|
||||||
| Args: | ||||||
| fo (:obj:``str``): Path to compressed file. Will fetch file using ``fsspec.open()`` | ||||||
| mode (:obj:``str``): Currently, only 'rb' accepted | ||||||
| target_protocol(:obj:``str``, optional): To override the FS protocol inferred from a URL. | ||||||
| target_options (:obj:``dict``, optional): Kwargs passed when instantiating the target FS. | ||||||
| fo (``str``): Path to compressed file. Will fetch file using ``fsspec.open()`` | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets remove all the double backticks here
Suggested change
|
||||||
| mode (``str``): Currently, only 'rb' accepted | ||||||
| target_protocol(``str``, optional): To override the FS protocol inferred from a URL. | ||||||
| target_options (``dict``, optional): Kwargs passed when instantiating the target FS. | ||||||
| """ | ||||||
| super().__init__(self, **kwargs) | ||||||
| self.fo = fo.__fspath__() if hasattr(fo, "__fspath__") else fo | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's a dataset class or method, you can use brackets to render it as a link :)