示例#1
0
    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)
示例#2
0
    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)
示例#3
0
文件: test.py 项目: taylor-bsg/hammer
 def test_load_yaml_empty_dict(self) -> None:
     """
     Test that load_yaml works with empty dictionaries.
     """
     self.assertEqual(hammer_config.load_yaml("x: {}"), {"x": {}})
示例#4
0
 def test_load_yaml_empty_dict(self) -> None:
     """
     Test that load_yaml works with empty dictionaries.
     """
     self.assertEqual(hammer_config.load_yaml("x: {}"), {"x": {}})