class_docstr: Tests initialization and instance methods of the ``Dataset`` class.
docstr: Test that __init_subclass__() does the following:
  
  - Does not create fields for _InitArg and ClassVar
  - collects fields from type annotations, including py_type
  - gets data name and identifiers from class arguments
docstr_tok: ["Test","that","__init_subclass__","(",")","does","the","following",":","-","Does","not","create","fields","for","_InitArg","and","ClassVar","-","collects","fields","from","type","annotations",",","including","py_type","-","gets","data","name","and","identifiers","from","class","arguments"]
code: def test_init_subclass(self):
      """Test that __init_subclass__() does the following:
  
      - Does not create fields for _InitArg and ClassVar
      - collects fields from type annotations, including py_type
      - gets data name and identifiers from class arguments
      """
  
      class NewDataset(
          Dataset, data_name="new_dataset", identifiers=("x", "y")
      ):  # pylint: disable= too-few-public-methods
          """Dataset"""
  
          class_info: ClassVar[str] = "Class variable"
  
          init_arg: int = _init_arg(1)
  
          x: int
          y: str = field(doc="y documentation")
          jsonable: Dict[str, str] = field(DatasetJSON, doc="json data")
  
      ds = NewDataset(init_arg=3, x=1, y="abc", jsonable={"a": "b"})
  
      assert ds.data_name == "new_dataset"
      assert ds.identifiers == {"x": 1, "y": "abc"}
  
      assert ds.attr_info["x"].py_type == "int"
      assert ds.attr_info["y"].py_type == "str"
      assert ds.attr_info["y"].doc == "y documentation"
      assert ds.attr_info["jsonable"].py_type == "dict[str, str]"
      assert ds.attr_info["jsonable"].doc == "json data"
  
imports: from numbers import Number
  from pathlib import Path
  from typing import ClassVar, Dict
  import numpy
  import pytest
  from pennylane.data import AttributeInfo, Dataset, DatasetJSON, DatasetNotWriteableError, DatasetScalar, attribute, field
  from pennylane.data.base.dataset import UNSET, _init_arg
  from pennylane.data.base.hdf5 import open_group
label_desc: Use image node_id 30 for calling the TestDataset obj's underlying member method code with example usage: obj.test_init_subclass() without return types