Skip to content

Commit 3d2ca56

Browse files
committed
feat: add version variable
1 parent 503e364 commit 3d2ca56

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

examples/models-usages/mlp-classification-regression/cancer_binary.ipynb

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,27 @@
4040
"from neuralnetlib.utils import train_test_split"
4141
]
4242
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": 2,
46+
"metadata": {},
47+
"outputs": [
48+
{
49+
"data": {
50+
"text/plain": [
51+
"'4.3.6'"
52+
]
53+
},
54+
"execution_count": 2,
55+
"metadata": {},
56+
"output_type": "execute_result"
57+
}
58+
],
59+
"source": [
60+
"import neuralnetlib\n",
61+
"neuralnetlib.__version__"
62+
]
63+
},
4364
{
4465
"cell_type": "markdown",
4566
"metadata": {},
@@ -361,7 +382,7 @@
361382
"name": "python",
362383
"nbconvert_exporter": "python",
363384
"pygments_lexer": "ipython3",
364-
"version": "3.10.8"
385+
"version": "3.12.10"
365386
}
366387
},
367388
"nbformat": 4,

neuralnetlib/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@
88
from . import preprocessing
99
from . import regularizers
1010
from . import utils
11-
from . import learners
11+
from . import learners
12+
13+
from importlib.metadata import version, PackageNotFoundError
14+
15+
try:
16+
__version__ = version("neuralnetlib")
17+
except PackageNotFoundError:
18+
__version__ = "0.0.0"

0 commit comments

Comments
 (0)