Skip to content

Commit

Permalink
removed ui.offset option, see issue #38
Browse files Browse the repository at this point in the history
  • Loading branch information
BenedictWilkins committed Nov 11, 2024
1 parent 983ba87 commit 429fd79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion matbii/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
avatar=avatar,
agents=agents,
svg_size=(config.ui.width, config.ui.height),
svg_position=config.ui.offset,
logging_path=config.logging.path,
terminate_after=config.experiment.duration,
)
Expand Down
15 changes: 10 additions & 5 deletions matbii/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
BaseModel,
Field,
field_validator,
NonNegativeInt,
# NonNegativeInt,
PositiveInt,
PositiveFloat,
model_validator,
Expand Down Expand Up @@ -207,10 +207,10 @@ class UIConfiguration(BaseModel, validate_assignment=True):
# default=(810, 680),
# description="The width and height of the canvas used to render the tasks. This should fully encapsulate all task elements. If a task appears to be off screen, try increasing this value.",
# )
offset: tuple[NonNegativeInt, NonNegativeInt] = Field(
default=(0, 0),
description="The x and y offset used when rendering the root UI element, can be used to pad the top/left of the window.",
)
# offset: tuple[NonNegativeInt, NonNegativeInt] = Field(
# default=(0, 0),
# description="The x and y offset used when rendering the root UI element, can be used to pad the top/left of the window.",
# )

@model_validator(mode="before")
@classmethod
Expand All @@ -222,6 +222,11 @@ def _validate_model(cls, data: dict[str, Any]):
data["width"] = data["size"][0]
data["height"] = data["size"][1]
del data["size"]
if "offset" in data:
LOGGER.warning(
"Configuration option: `ui.offset` is deprecated and has been removed as an option, please instead modify the coordinates of each task to reflect the desired offset."
)
del data["offset"]
return data


Expand Down

0 comments on commit 429fd79

Please sign in to comment.