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

Fix for #114 #115

Merged
merged 1 commit into from
Jan 10, 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
2 changes: 1 addition & 1 deletion pydsdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys as _sys
from pathlib import Path as _Path

__version__ = "1.22.1"
__version__ = "1.22.2"
__version_info__ = tuple(map(int, __version__.split(".")[:3]))
__license__ = "MIT"
__author__ = "OpenCyphal"
Expand Down
6 changes: 3 additions & 3 deletions pydsdl/_dsdl_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class PathInferenceError(UndefinedDataTypeError):
Raised when the namespace, type, fixed port ID, or version cannot be inferred from a file path.
"""

def __init__(self, text: str, dsdl_path: Path, valid_dsdl_roots: list[Path]):
super().__init__(text=text, path=Path(dsdl_path))
def __init__(self, text: str = "", dsdl_path: Path | None = None, valid_dsdl_roots: list[Path] | None = None):
super().__init__(text=text, path=dsdl_path)
self.valid_dsdl_roots = valid_dsdl_roots[:] if valid_dsdl_roots is not None else None


Expand Down Expand Up @@ -83,7 +83,7 @@ def _infer_path_to_root_from_first_found(cls, dsdl_path: Path, valid_dsdl_roots:
"this root folder or provide a valid root path.",
dsdl_path,
valid_dsdl_roots,
)
) from None
return directly_inferred

# INFERENCE 2: The next easiest inference is when the target path is relative to a known dsdl root. These
Expand Down
Loading