Skip to content

Commit

Permalink
[Hotfix] Config version set to 1.0 (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
klemen1999 authored Oct 16, 2024
1 parent 6bcbb11 commit e34965d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion luxonis_ml/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "0.4.1"
4 changes: 3 additions & 1 deletion luxonis_ml/nn_archive/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

from .model import Model

CONFIG_VERSION = Literal["1.0", "1.1"]
# NOTE: Change in CONFIG_VERSION is a breaking change and should be communicated
# to all other packages that relly on it before pushed to release
CONFIG_VERSION = Literal["1.0"]


class Config(BaseModelExtraForbid):
Expand Down
20 changes: 18 additions & 2 deletions tests/test_nn_archive/test_nn_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from pydantic import ValidationError

from luxonis_ml.nn_archive import ArchiveGenerator, is_nn_archive
from luxonis_ml.nn_archive.model import Input, Output
from luxonis_ml.nn_archive.model import HeadType, Input, Output

DATA_DIR = Path("tests/data/test_nn_archive")

Expand Down Expand Up @@ -91,7 +91,7 @@ def test_archive_generator(
archive_name=archive_name,
save_path="tests/data/test_nn_archive",
cfg_dict={
"config_version": "1.1",
"config_version": "1.0",
"model": {
"metadata": {
"name": "test_model",
Expand Down Expand Up @@ -132,6 +132,22 @@ def test_archive_generator(
assert "config.json" in tar.getnames()


def test_optional_head_name():
from luxonis_ml.nn_archive.config_building_blocks.base_models.head_metadata import (
HeadMetadata,
)

# without head name
HeadType(parser="Parser", metadata=HeadMetadata(), outputs=["output"]) # type: ignore
# with head name
HeadType(
parser="Parser",
name="HeadName",
metadata=HeadMetadata(), # type: ignore
outputs=["output"],
)


def test_layout():
default = {
"name": "input",
Expand Down

0 comments on commit e34965d

Please sign in to comment.