Registry
Top-level waveform registry.
A single, family-agnostic entry point for constructing waveforms by name. Each
Waveform subclass registers itself with register. Users then construct
any model through waveform without importing the implementing module:
import ripplegw
wf = ripplegw.waveform("IMRPhenomXAS", f_ref=20.0)
ripplegw.list_waveforms(domain="FD")
Adding a family means adding a self-registering module — never editing this file.
Functions:
| Name | Description |
|---|---|
get_waveform_metadata |
Return a copy of the descriptive metadata for a registered waveform. |
list_waveforms |
List registered waveform names, optionally filtered by metadata. |
register |
Class decorator that adds a |
waveform |
Construct a registered waveform by name. |
Attributes:
| Name | Type | Description |
|---|---|---|
WAVEFORM_REGISTRY |
dict[str, type[Waveform]]
|
Global name -> |
WAVEFORM_REGISTRY: dict[str, type[Waveform]] = {}
module-attribute
¤
Global name -> Waveform subclass registry, populated at import by
register.
get_waveform_metadata(name: str) -> dict[str, Any]
¤
Return a copy of the descriptive metadata for a registered waveform.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A registered model name. |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The model's metadata, e.g. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
list_waveforms(**filters) -> list[str]
¤
List registered waveform names, optionally filtered by metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**filters
|
Constraints on |
{}
|
Returns:
| Type | Description |
|---|---|
list[str]
|
Sorted matching names. |
register(name: Optional[str] = None, *, override: bool = False, **metadata)
¤
Class decorator that adds a Waveform subclass to the registry.
Keyword arguments are stored on the class as waveform_metadata; that is
what list_waveforms filters on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
Optional[str]
|
Registry key users pass to |
None
|
override
|
bool
|
Allow replacing a name that is already registered. |
False
|
**metadata
|
Descriptive tags, e.g. |
{}
|
Returns:
| Type | Description |
|---|---|
|
The decorator, which returns the class unchanged. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
TypeError
|
If the decorated class is not a |
waveform(name: str, /, **config) -> Waveform
¤
Construct a registered waveform by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
A registered model name (see |
required |
**config
|
Constructor configuration forwarded to the model
(e.g. |
{}
|
Returns:
| Type | Description |
|---|---|
Waveform
|
A configured instance, callable as |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |