Skip to content

Commit

Permalink
Merge pull request #34 from pyiron/remove_otype
Browse files Browse the repository at this point in the history
get rid of `otype`
  • Loading branch information
samwaseda authored Jan 7, 2025
2 parents 8bcaaba + 0e80eae commit 272664c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
13 changes: 7 additions & 6 deletions semantikon/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ def parse_metadata(value):
value: Quantity object
Returns:
dictionary of the metadata. Available keys are `units`, `otype`,
`shape`, and `dtype`. See `semantikon.typing.u` for more details.
dictionary of the metadata. Available keys are `units`, `label`,
`triple`, `uri` and `shape`. See `semantikon.typing.u` for more details.
"""
# When there is only one metadata `use_list=False` must have been used
if len(value.__metadata__) == 1 and isinstance(value.__metadata__[0], str):
Expand Down Expand Up @@ -79,8 +79,8 @@ def parse_input_args(func: callable):
func: function to be parsed
Returns:
dictionary of the input arguments. Available keys are `units`, `otype`,
and `shape`. See `semantikon.typing.u` for more details.
dictionary of the input arguments. Available keys are `units`, `label`,
`triple`, `uri` and `shape`. See `semantikon.typing.u` for more details.
"""
return {
key: _meta_to_dict(value.annotation)
Expand All @@ -97,8 +97,9 @@ def parse_output_args(func: callable):
Returns:
dictionary of the output arguments if there is only one output. Otherwise,
a list of dictionaries is returned. Available keys are `units`, `otype`,
and `shape`. See `semantikon.typing.u` for more details.
a list of dictionaries is returned. Available keys are `units`,
`label`, `triple`, `uri` and `shape`. See `semantikon.typing.u` for
more details.
"""
sig = inspect.signature(func)
if get_origin(sig.return_annotation) is tuple:
Expand Down
2 changes: 0 additions & 2 deletions semantikon/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def u(
/,
units: str | None = None,
label: str | None = None,
otype: str | tuple | None = None,
triple: tuple[tuple[str, str, str], ...] | tuple[str, str, str] | None = None,
uri: str | None = None,
shape: tuple[int] | None = None,
Expand All @@ -27,7 +26,6 @@ def u(
result = {
"units": units,
"label": label,
"otype": otype,
"triple": triple,
"uri": uri,
"shape": shape,
Expand Down
1 change: 0 additions & 1 deletion tests/unit/test_dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_parse_metadata(self):
"units": "eV",
"label": "TotalEnergy",
"associate_to_sample": True,
"otype": None,
"triple": None,
"shape": None,
"uri": None,
Expand Down

0 comments on commit 272664c

Please sign in to comment.