Skip to content

Commit

Permalink
Rename to table_cell
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Feb 7, 2024
1 parent f24a62f commit b7a160e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/sciline/_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"""Callable that can be converted to a provider."""

ProviderKind = Literal[
'function', 'parameter', 'series', 'table_label', 'sentinel', 'unsatisfied'
'function', 'parameter', 'series', 'table_cell', 'sentinel', 'unsatisfied'
]
"""Identifies the kind of a provider, most are used internally."""

Expand Down Expand Up @@ -80,14 +80,14 @@ def parameter(cls, param: Any) -> Provider:
)

@classmethod
def table_label(cls, param: Any) -> Provider:
def table_cell(cls, param: Any) -> Provider:
"""Construct a provider that returns the label for a table row."""
return cls(
func=lambda: param,
arg_spec=ArgSpec.null(),
kind='table_label',
kind='table_cell',
location=ProviderLocation(
name=f'table_label({type(param).__name__})', module=_module_name(param)
name=f'table_cell({type(param).__name__})', module=_module_name(param)
),
)

Expand Down
2 changes: 1 addition & 1 deletion src/sciline/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _provider_source(
p: Tuple[Key, Tuple[Union[Key, TypeVar], ...], List[Provider]]
) -> str:
key, _, (v, *rest) = p
if v.kind == 'table_label':
if v.kind == 'table_cell':
# This is always the case, but mypy complains
if isinstance(key, Item):
return escape(
Expand Down
4 changes: 2 additions & 2 deletions src/sciline/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,12 @@ def set_param_table(self, params: ParamTable) -> None:
for index, label in zip(params.index, values):
self._set_provider(
Item((Label(tp=params.row_dim, index=index),), param_name),
Provider.table_label(label),
Provider.table_cell(label),
)
for index, label in zip(params.index, params.index):
self._set_provider(
Item((Label(tp=params.row_dim, index=index),), params.row_dim),
Provider.table_label(label),
Provider.table_cell(label),
)

def del_param_table(self, row_dim: type) -> None:
Expand Down

0 comments on commit b7a160e

Please sign in to comment.