MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / load

Method load

src/bcf/bcf/v2/bcfxml.py:153–170  ·  view source on GitHub ↗

Create a BcfXml object from a file. Args: filename: Path to the file. xml_handler: XML parser and serializer. Returns: A BcfXml object with the file contents. Raises: ValueError: If the file name is null or empty

(cls, filename: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None)

Source from the content-addressed store, hash-verified

151
152 @classmethod
153 def load(cls, filename: Path, xml_handler: Optional[AbstractXmlParserSerializer] = None) -> Optional[BcfXml]:
154 """
155 Create a BcfXml object from a file.
156
157 Args:
158 filename: Path to the file.
159 xml_handler: XML parser and serializer.
160
161 Returns:
162 A BcfXml object with the file contents.
163
164 Raises:
165 ValueError: If the file name is null or empty
166 """
167 if not filename:
168 raise ValueError("filename is required")
169 xml_handler = xml_handler or XmlParserSerializer()
170 return cls(xml_handler=xml_handler, filename=filename)
171
172 @classmethod
173 def create_new(

Callers 13

test_maximum_informationFunction · 0.45
test_bcf_roundtripFunction · 0.45
test_bcf_edit_saveasFunction · 0.45
test_bcf_editFunction · 0.45
test_load_no_filenameFunction · 0.45
test_doc_ref_internalFunction · 0.45
test_bcf_roundtripFunction · 0.45
test_bcf_edit_saveasFunction · 0.45
test_bcf_editFunction · 0.45
test_load_no_filenameFunction · 0.45

Calls 1

XmlParserSerializerClass · 0.90

Tested by 12

test_maximum_informationFunction · 0.36
test_bcf_roundtripFunction · 0.36
test_bcf_edit_saveasFunction · 0.36
test_bcf_editFunction · 0.36
test_load_no_filenameFunction · 0.36
test_doc_ref_internalFunction · 0.36
test_bcf_roundtripFunction · 0.36
test_bcf_edit_saveasFunction · 0.36
test_bcf_editFunction · 0.36
test_load_no_filenameFunction · 0.36