class ip_manager.testing.VFab2DReferenceTest

Test a 2D virtual fabrication material result against a known-good reference file.


from ip_manager.testing import VFab2DReferenceTest
from ipkiss.plugins.vfabrication.process_flow import VFabricationProcessFlow
import pytest

my_process_flow = VFabricationProcessFlow(...)

class TestMyVFab(VFab2DReferenceTest):
    def resolution(self):
        return 50   # 1/50 um grid

    def process_flow(self):
        return my_process_flow

Fixture to configure the resolution of the virtual fabrication.

The grid of the virtual fabrication will be 1 / resolution user units. Defaults to 20 (hence, with user units in microns, the default grid is 50nm).


Fixture for configuring the virtual fabrication processs flow.



Fixture for configuring the material stack factory to use.

For advanced use only. Defaults to TECH.MATERIAL_STACKS.

material_array(component, resolution, process_flow, material_stack_factory)

Fixture returning the 2D material array to be tested.

test_vfab2d_to_array(material_array, reference_folder, temp_folder, reference_name)
create_reference_vfab2d_to_array(component, process_flow, material_array, reference_folder, reference_name)

Fixture returning the component (i3.PCell object) to be tested.

Needs to be implemented by the user.


Fixture specifying the library name to use in the files.

Defaults to component.name.

reference_folder(request, reference_folder_name)

Fixture returning the full reference folder path

Creates the necessary directories if they don’t exist. Should not be overridden (use ‘reference_folder_name’ instead).


Fixture for configuring the relative folder path in which the known-good reference files are saved.

Defaults to ‘ref’


Fixture for configuring the reference file name, without the folder path.

Defaults to the class name of the test class. Should be overridden when defining parametrized tests!

temp_folder(request, temp_folder_name)

Fixture returning the full temporary folder path.

Creates the necessary directories if they don’t exist. Should not be overridden (use ‘temp_folder_name’ instead).


Fixture specifying the relative folder path in which the temporary files are saved.

Defaults to be the same as reference_folder_name.