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

[Hotfix] Config version set to 1.0 #190

Merged
merged 3 commits into from
Oct 16, 2024
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
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
Loading