Skip to content

Commit

Permalink
Stored version number in __version__ and version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jegp committed Apr 23, 2024
1 parent 32435cb commit d5b9f5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 5 additions & 5 deletions nir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
Documentation: https://nnir.readthedocs.io
"""

from importlib.metadata import version, PackageNotFoundError
from importlib.metadata import version as metadata_version, PackageNotFoundError

try:
__version__ = version("nir")
__version__ = version = metadata_version("nir")
del metadata_version
except PackageNotFoundError:
# package is not installed
pass
# package is not installed
pass

from . import ir
from .ir import * # noqa: F403
from .ir import typing # noqa: F401
from .serialization import read, write

__all__ = ir.__all__ + ["read", "write"]

4 changes: 3 additions & 1 deletion nir/serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def read_node(node: Any) -> nir.NIRNode:
r=node["r"][()], v_threshold=node["v_threshold"][()], **_read_metadata(node)
)
elif node["type"][()] == b"Input":
return nir.Input(input_type={"input": node["shape"][()]}, **_read_metadata(node))
return nir.Input(
input_type={"input": node["shape"][()]}, **_read_metadata(node)
)
elif node["type"][()] == b"LI":
return nir.LI(
tau=node["tau"][()],
Expand Down

0 comments on commit d5b9f5a

Please sign in to comment.