Skip to content

Commit

Permalink
Enable alias field for reference product
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Jun 15, 2024
1 parent 6837262 commit 9fb073f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions bw_interface_schemas/lci.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,19 @@ class Process(Node):
class ProcessWithReferenceProduct(Process):
"""Chimaera which serves as both a product and a process in the graph."""

# Was previously "reference product", need the underscore here
# Use `ProcessWithReferenceProduct.model_dump(by_alias=True)`
# to get a dictionary using the alias field
reference_product: str = Field(alias="reference product")
# Optional name for the amount of reference product produced.
# Duplicates information in the exchanges.
# Should be net amount.
production_amount: Optional[float] = None
# Properties for reference product
properties: dict[str, Union[float, int]]
properties: Optional[dict[str, Union[float, int]]] = None

class Config:
populate_by_name = True
model_config = ConfigDict(
populate_by_name=False,
)


class Product(Node):
Expand Down

0 comments on commit 9fb073f

Please sign in to comment.