Created
April 23, 2023 19:28
-
-
Save shalabhc/5712993a3726abdb8b657a351cb1d4b5 to your computer and use it in GitHub Desktop.
Sample dagster starter file for gdsfactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run `dagster dev -f chip.py` | |
from dagster import Definitions | |
from dagster import asset, ConfigurableResource | |
from typing import Dict | |
class ReaderResource(ConfigurableResource): | |
value: str | |
def normalize_data(text): | |
return {} | |
@asset | |
def design_data(reader: ReaderResource) -> Dict: | |
# read_data_based_on_config() | |
return {"design:": reader.value} | |
@asset | |
def verification_data(): | |
return {"verification:": 1} | |
@asset | |
def manufacturing_data(): | |
return {"manufacturing:": 1} | |
@asset | |
def validation_data(): | |
return {"validation:": 1} | |
@asset | |
def structure_layer(context, design_data, verification_data, manufacturing_data, validation_data): | |
combined = {**design_data, **verification_data, **manufacturing_data, **validation_data} | |
context.log.info(f"Combined data {combined}") | |
return combined | |
defs = Definitions( | |
assets=[design_data, verification_data, manufacturing_data, validation_data], | |
resources={"reader": ReaderResource(value="configured-value")} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment