-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use packaging for colmap version #2814
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change/suggestion then looks good to me! Cool update! 😀
CONSOLE.print(f"[bold red]Could not find COLMAP version. Using default {default_version}") | ||
default_version = Version(str(default_version)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could lead to possible issues since the arg is overwritten. I suggest we type default_version as a string in the default arg and then skip to return Version(default_version) without having an intermediate copy or string conversion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be addressed in the latest commit!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* Use packaging.version for colmap version * Run ruff * Change default_version to str type
Changes the way we check the version for
colmap
command.Using
Version
objects frompackaging.version
should be more stable than using float comparisons (3.7, 3.8, ...), which might break when the version cannot be represented as a float (e.g., 3.9.1).