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

Use packaging for colmap version #2814

Merged
merged 3 commits into from
Jan 25, 2024
Merged

Use packaging for colmap version #2814

merged 3 commits into from
Jan 25, 2024

Conversation

chungmin99
Copy link
Contributor

Changes the way we check the version for colmap command.

Using Version objects from packaging.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).

@chungmin99 chungmin99 changed the title Use packaging.version for colmap version Use packaging for colmap version Jan 24, 2024
@chungmin99 chungmin99 marked this pull request as ready for review January 24, 2024 01:26
@chungmin99 chungmin99 requested a review from ethanweber January 24, 2024 01:26
Copy link
Collaborator

@ethanweber ethanweber left a 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))
Copy link
Collaborator

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.

Copy link
Contributor Author

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!

Copy link
Collaborator

@ethanweber ethanweber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@chungmin99 chungmin99 merged commit 3db0801 into main Jan 25, 2024
2 checks passed
@chungmin99 chungmin99 deleted the cmk/colmap_version branch January 25, 2024 00:02
ArpegorPSGH pushed a commit to ArpegorPSGH/nerfstudio that referenced this pull request Jun 22, 2024
* Use packaging.version for colmap version

* Run ruff

* Change default_version to str type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants