Skip to content

Fix open photogrammetry example not working on Windows#3705

Merged
Wumpf merged 5 commits into
mainfrom
andreas/fix-opf-windows
Oct 11, 2023
Merged

Fix open photogrammetry example not working on Windows#3705
Wumpf merged 5 commits into
mainfrom
andreas/fix-opf-windows

Conversation

@Wumpf
Copy link
Copy Markdown
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
Copy Markdown
Member Author

Wumpf commented Oct 5, 2023

note to self: create an issue on the pyopf project

Comment thread examples/python/open_photogrammetry_format/main.py
Comment thread examples/python/open_photogrammetry_format/main.py Outdated
@Wumpf
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

teh-cmc commented Oct 11, 2023

There you go

Comment thread scripts/lint.py
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Copy link
Copy Markdown

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
@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