Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get rid of otype #34

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading