Skip to content

Commit

Permalink
Added energy_scale
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner-andrulis committed Jun 5, 2024
1 parent 3a4eb5a commit 12fded3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions timeloopfe/v4/arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ def declare_attrs(cls, *args, **kwargs):
super().add_attr("subclass", str, None)
super().add_attr("required_actions", list, [])
super().add_attr("area_scale", Number, None)
super().add_attr("energy_scale", Number, None)
super().add_attr("enabled", bool, True)

def __init__(self, *args, **kwargs):
Expand All @@ -336,6 +337,7 @@ def __init__(self, *args, **kwargs):
self.subclass: str = self["subclass"]
self.required_actions: List[str] = self["required_actions"]
self.area_scale: float = self["area_scale"]
self.energy_scale: float = self["energy_scale"]
self.enabled: bool = self["enabled"]

def _check_unrecognized(self, *args, **kwargs):
Expand Down
2 changes: 2 additions & 0 deletions timeloopfe/v4/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ def declare_attrs(cls, *args, **kwargs):
super().add_attr("name", str)
super().add_attr("attributes", ComponentAttributes, {})
super().add_attr("area_scale", (Number, str), 1)
super().add_attr("energy_scale", (Number, str), 1)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.name: str = self["name"]
self.attributes: ComponentAttributes = self["attributes"]
self.area_scale: Union[Number, str] = self["area_scale"]
self.energy_scale: Union[Number, str] = self["energy_scale"]


class ComponentAttributes(DictNode):
Expand Down

0 comments on commit 12fded3

Please sign in to comment.