Exemple #1
0
def rebuild_library(path_library=CONFIG["gdslib"]):
    """ saves all components in component_type2factory to the gdslib library
    """
    for component_type, _ in component_type2factory.items():
        same_hash = compare_component_hash(component_type,
                                           path_library=path_library)
        if not same_hash:
            lock_component(component_type, path_library=path_library)
            print(f"Replaced `{component_type}` by new one")
Exemple #2
0
def test_all_components(component_type2factory=component_type2factory,
                        path_library=CONFIG["gdslib"]):
    # pull_library(path_library)

    for component_type, _ in component_type2factory.items():
        assert compare_component_hash(
            component_type=component_type,
            component_type2factory=component_type2factory,
            path_library=path_library,
        ), f"{component_type} changed from component locked in the library {path_library}"
Exemple #3
0
def print_components_with_changes(
        component_type2factory=component_type2factory,
        path_library=path_library):
    """  locks only components whose hash changed
    """
    for component_type, _ in component_type2factory.items():
        same_hash = compare_component_hash(
            component_type,
            component_type2factory=component_type2factory,
            path_library=path_library,
        )
        if same_hash:
            print(f"[V] {component_type}")
        else:
            print(f"[X] {component_type} changed hash")
Exemple #4
0
def lock_components_with_changes(component_type2factory=component_type2factory,
                                 path_library=path_library):
    """  locks only components whose hash changed
    """
    for component_type, _ in component_type2factory.items():
        same_hash = compare_component_hash(
            component_type=component_type,
            component_type2factory=component_type2factory,
            path_library=path_library,
        )
        if not same_hash:
            print(f"locking {component_type} to {path_library}")
            lock_component(
                component_type=component_type,
                component_type2factory=component_type2factory,
                path_library=path_library,
            )