Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmilkov committed Jan 26, 2024
1 parent c188627 commit 36cabdd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lilac/signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ def register_signal(signal_cls: Type[Signal], exists_ok: bool = False) -> None:
signal_cls: The signal class to register.
exists_ok: Whether to allow overwriting an existing signal.
"""
if not hasattr(signal_cls, 'name'):
raise ValueError(f'Signal "{signal_cls.__name__}" needs to have a "name" attribute.')

if signal_cls.name in SIGNAL_REGISTRY and not exists_ok:
raise ValueError(f'Signal "{signal_cls.name}" has already been registered!')

Expand Down
7 changes: 4 additions & 3 deletions web/blueprint/src/lib/components/signals/SignalView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@
}
};
$: hasOptions =
Object.keys(signalInfo?.json_schema?.properties || {}).filter(p => p != 'signal_name').length >
0;
Object.keys(signalInfo?.json_schema?.properties || {}).filter(
p => ['signal_name', 'supports_garden'].indexOf(p) < 0
).length > 0;
</script>

<div class="flex h-full w-full flex-col gap-y-8 px-10">
Expand Down Expand Up @@ -204,7 +205,7 @@
bind:value={propertyValues}
bind:validationErrors={errors}
showDescription={false}
hiddenProperties={['/signal_name']}
hiddenProperties={['/signal_name', '/supports_garden']}
customComponents={customComponents[signalInfo?.name]}
/>
</div>
Expand Down

0 comments on commit 36cabdd

Please sign in to comment.