Skip to content

Loading of the opf-spec example fails #3

@abey79

Description

@abey79

I tried loading the opf-spec example but it failed with the following error:

>>> from pyopf.resolve import resolve
>>> p =resolve(load("examples/project.json"))
Traceback (most recent call last):
  File "/Users/hhip/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/231.9011.38/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "/Users/hhip/src/opf-spec/venv/lib/python3.11/site-packages/pyopf/resolve/resolver.py", line 96, in resolve
    obj = io.load(item.resources[0].uri, project.base_uri)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hhip/src/opf-spec/venv/lib/python3.11/site-packages/pyopf/io/loaders.py", line 145, in load
    return loader(*params)
           ^^^^^^^^^^^^^^^
  File "/Users/hhip/src/opf-spec/venv/lib/python3.11/site-packages/pyopf/io/loaders.py", line 35, in _load_from_json
    with open(str(uri)) as f:
         ^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/hhip/src/opf-spec/examples/cameras.json'

It looks like opf-spec/examples/project.json has many mis-formatted links to resource files (- vs _)—I'm not sure if this is intensional. Are there other example projects available for testing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions