class_docstr: Wandb class for 3D Molecular data.
  
  Arguments:
      data_or_path: (string, io)
          Molecule can be initialized from a file name or an io object.
      caption: (string)
          Caption associated with the molecule for display.
class_docstr_tok: ["Wandb","class","for","3D","Molecular","data",".","Arguments",":","data_or_path",":","(","string",",","io",")","Molecule","can","be","initialized","from","a","file","name","or","an","io","object",".","caption",":","(","string",")","Caption","associated","with","the","molecule","for","display","."]
code: def seq_to_json(
      cls: Type["Molecule"],
      seq: Sequence["BatchableMedia"],
      run: "LocalRun",
      key: str,
      step: Union[int, str],
  ) -> dict:
      seq = list(seq)
  
      jsons = [obj.to_json(run) for obj in seq]
  
      for obj in jsons:
          expected = LogicalPath(cls.get_media_subdir())
          if not obj["path"].startswith(expected):
              raise ValueError(
                  "Files in an array of Molecule's must be in the {} directory, not {}".format(
                      cls.get_media_subdir(), obj["path"]
                  )
              )
  
      return {
          "_type": "molecule",
          "filenames": [obj["path"] for obj in jsons],
          "count": len(jsons),
          "captions": Media.captions(seq),
      }
  
file_path: wandb/wandb/sdk/data_types/molecule.py
imports: import io
  import os
  import pathlib
  from typing import TYPE_CHECKING, Optional, Sequence, Type, Union
  from wandb import util
  from wandb.sdk.lib import runid
  from wandb.sdk.lib.paths import LogicalPath
  from ._private import MEDIA_TMP
  from .base_types.media import BatchableMedia, Media
label_desc: Use image node_id 6 for calling the Molecule obj's underlying member method code with example usage: obj.seq_to_json(cls, seq, run, key, step) and returns: dict