Quickstart
This guide will get you all set up and ready to use the PreFab API. We'll cover how to get started using one of our virtual nanofabrication models and how to make your first prediction. We'll also look at where to go next to find all the information you need to take full advantage of our tools.
Before you can make PreFab requests, you will need to create an account. Sign up here.
Install PreFab
Before making your first prediction, you need to install PreFab. In addition to PyPI (pip), PreFab can be installed from GitHub, which makes it easier to make changes to the source code for your own development purposes.
pip install prefab
Authenticate PreFab Token
To link your PreFab account to the API, you will need to authenticate your token. You can do this by running the following command in your terminal. This will open a browser window where you can log in and authenticate your token.
python3 -m prefab setup
Making your first prediction
After installing PreFab, you are ready to start making predictions in just a few short lines of code. Simply import PreFab, load a device from a GDS file or image, and make a prediction using one of our models.
import prefab as pf
device = pf.load_device_gds(path="<path_to_your_gds_file>", cell_name="<your_gds_cell_name>")
MODEL_NAME = "ANT_NanoSOI" # example model name
MODEL_TAGS = "v6-d7" # example model tags
prediction = pf.predict(device=device, model_name=MODEL_NAME, model_tags=MODEL_TAGS)
What's next?
Great, you're now set up with the API and have made your first prediction. Here are a few links that might be handy as you venture further into PreFab: