MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / to_dict

Method to_dict

examples/ply_loader_renderer.py:119–138  ·  view source on GitHub ↗

Convert the CompressionConfig instance to a dictionary. If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method. Fields with None values (use_sort, verbose) will be excluded from the resulting dictionary.

(self)

Source from the content-addressed store, hash-verified

117 attribute_codec_registry: Optional[AttributeCodecs] = field(default_factory=lambda: AttributeCodecs())
118
119 def to_dict(self) -> Dict[str, Any]:
120 """
121 Convert the CompressionConfig instance to a dictionary.
122 If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method.
123 Fields with None values (use_sort, verbose) will be excluded from the resulting dictionary.
124 """
125 result = {
126 "use_sort": self.use_sort,
127 "verbose": self.verbose,
128 "n_clusters": self.n_clusters,
129 }
130
131 if self.qp is not None:
132 result["qp"] = self.qp
133
134 # handle attribute_codec_registry
135 if self.attribute_codec_registry is not None:
136 result["attribute_codec_registry"] = self.attribute_codec_registry.to_dict()
137
138 return result
139
140@dataclass
141class Config:

Callers

nothing calls this directly

Calls 1

to_dictMethod · 0.45

Tested by

no test coverage detected