def load_from_yaml(cls, technology_name: str, yaml_str: str, path: str) -> "HammerTechnology": """Load a technology from a given folder. :param technology_name: Technology name (e.g. "saed32") :param yaml_str: yaml string to use as the technology yaml :param path: Path to set as the technology folder (e.g. foo/bar/technology/saed32) """ return HammerTechnology.load_from_json(technology_name, json.dumps(load_yaml(yaml_str), cls=HammerJSONEncoder), path)
def load_from_yaml(cls, technology_name: str, yaml_str: str, path: str) -> "HammerTechnology": """Load a technology from a given folder. :param technology_name: Technology name (e.g. "asap7") :param yaml_str: yaml string to use as the technology yaml :param path: Path to set as the technology folder (e.g. foo/bar/technology/asap7) """ return HammerTechnology.load_from_json( technology_name, json.dumps(load_yaml(yaml_str), cls=HammerJSONEncoder), path)
def test_load_yaml_empty_dict(self) -> None: """ Test that load_yaml works with empty dictionaries. """ self.assertEqual(hammer_config.load_yaml("x: {}"), {"x": {}})