Installing RAIMAD
RAIMAD is a Python package that supports Python 3.12, 3.11, and 3.10.
You can install it with pip
:
pip install raimad
Check the installation worked
RAIMAD ships with a sample Snowman component. You can try exporting the snowman to a CIF file to check that RAIMAD is installed correctly:
import raimad as rai
snowman = rai.Snowman()
rai.show(snowman)
The rai.show()
command should open KLayout and display the snowman.
KLayout is highly recommended.
is a CIF viewer recommended for use with RAIMAD.
If you don't want to install KLayout,
you can directly export the snowman
to a file of your choosing:
import raimad as rai
rai.export_cif(rai.Snowman(), '/path/to/output/file.cif')
Dependencies
RAIMAD depends only on the typing-extensions
module,
which pip
will install automatically.
RAIMAD in Jupyter
It is discouraged but possible to use RAIMAD in Jupyter. The documentation page provides some relevant information.
Windows paths
This tutorial assumes a unix-like operating system. If you are using RAIMAD in windows, please take note of the following difference:
Windows uses the backslash \
as a Path separator.
To prevent Python from interpreting backslashes in path strings
as escape sequences, either double them or put an r
before
the opening quote:
mypath1 = "C:\\Path\\To\\File.cif"
mypath2 = r"C:\Path\To\File.cif"
If you're writing code that you intend to share with others, consider using Python's built-in pathlib module for cross-platform compatibility.
RAIMAD Tutorial
The Basics of RAIMAD