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 open photogrammetry example not working on Windows #3705

Merged
merged 5 commits into from
Oct 11, 2023

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Oct 5, 2023

What

Fixes python .\examples\python\open_photogrammetry_format\main.py on Windows

Was getting

Traceback (most recent call last):
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 220, in <module>
    main()
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 209, in main
    project = OPFProject.from_dataset(args.dataset, log_as_frames=not args.no_frames)
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 107, in from_dataset
    return cls(DATASET_DIR / spec.dir_name / "project.opf", log_as_frames=log_as_frames)
  File "C:\dev\rerun\rerun\examples\python\open_photogrammetry_format\main.py", line 85, in __init__
    self.project = resolve(load(str(path)))
  File "C:\Python310\lib\site-packages\pyopf\io\loaders.py", line 143, in load
    accepted, params = test(resource, base_uri, additional_resources)
  File "C:\Python310\lib\site-packages\pyopf\io\loaders.py", line 73, in _test_json_resource
    uri = join_uris(resource, base_uri)
  File "C:\Python310\lib\site-packages\pyopf\io\loaders.py", line 31, in join_uris
    raise RuntimeError("Non-file URIs are not supported")
RuntimeError: Non-file URIs are not supported

before. With the fix here it runs fine

Checklist

@Wumpf Wumpf added 🪳 bug Something isn't working examples Issues relating to the Rerun examples 🪟 windows Problems specific to the Windows OS include in changelog labels Oct 5, 2023
@Wumpf
Copy link
Member Author

Wumpf commented Oct 5, 2023

note to self: create an issue on the pyopf project

examples/python/open_photogrammetry_format/main.py Outdated Show resolved Hide resolved
@Wumpf
Copy link
Member Author

Wumpf commented Oct 11, 2023

@emilk it's nice that you added a link, but via lint.py we actually don't allow that and enforce the TODO(#) syntax. You can fight that out with @teh-cmc if you want ;)

@teh-cmc
Copy link
Member

teh-cmc commented Oct 11, 2023

@emilk it's nice that you added a link, but via lint.py we actually don't allow that and enforce the TODO(#) syntax. You can fight that out with @teh-cmc if you want ;)

# TODO(Pix4D/pyopf#6): https://github.com/Pix4D/pyopf/issues/6 should be valid though 🤔 lemme check...

@teh-cmc
Copy link
Member

teh-cmc commented Oct 11, 2023

There you go

@@ -30,7 +30,7 @@

any_todo_pattern = re.compile(r"TODO\(.*\)")
legal_todo_inner_pattern = re.compile(
r"TODO\(((?:[a-zA-Z\-_/]+)?#\d+|[a-zA-Z]+)(?:,\s*((?:[a-zA-Z\-_/]+)?#\d+|[a-zA-Z]+))*\)"
r"TODO\(((?:[a-zA-Z\-_/]+[a-zA-Z\-_/\d]+)?#\d+|[a-zA-Z]+)(?:,\s*((?:[a-zA-Z\-_/]+)?#\d+|[a-zA-Z]+))*\)"
Copy link
Member

@emilk emilk Oct 11, 2023

Choose a reason for hiding this comment

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

this is over-complicated. so much unnecessary stuff in there

TODO\([\w/-]*(#\d+)?\)

should suffice

Copy link
Member Author

Choose a reason for hiding this comment

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

... I gonna ignore this for now and merge ahead. Users deserve this sample working on windows, independent of this regex 😄

Copy link
Member

Choose a reason for hiding this comment

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

I'll fix it then

Choose a reason for hiding this comment

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

should be fixed in Pix4D/pyopf#9 ;) thanks

@Wumpf Wumpf merged commit fffcfa4 into main Oct 11, 2023
30 checks passed
@Wumpf Wumpf deleted the andreas/fix-opf-windows branch October 11, 2023 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working examples Issues relating to the Rerun examples include in changelog 🪟 windows Problems specific to the Windows OS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants