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

failed to load example assets/test_file.omf #75

Open
rminhxm opened this issue May 21, 2019 · 4 comments
Open

failed to load example assets/test_file.omf #75

rminhxm opened this issue May 21, 2019 · 4 comments

Comments

@rminhxm
Copy link

rminhxm commented May 21, 2019

Trying to run this example to load assets/test_file.omf but failed:
https://mybinder.org/v2/gh/OpenGeoVis/omfvista/master?filepath=Example.ipynb

Error messages:

Traceback (most recent call last):
  File "Example.py", line 36, in <module>
    proj = omfvista.load_project('assets/test_file.omf')
  File "E:\Python37\lib\site-packages\omfvista\wrapper.py", line 124, in load_project
    return project_to_vtk(project)
  File "E:\Python37\lib\site-packages\omfvista\wrapper.py", line 115, in project_to_vtk
    d = omfvista.wrap(e)
  File "E:\Python37\lib\site-packages\omfvista\wrapper.py", line 103, in wrap
    return wrappers[key](data)
  File "E:\Python37\lib\site-packages\omfvista\pointset.py", line 29, in point_s
et_to_vtk
    points = pse.geometry.vertices
AttributeError: 'PointSetElement' object has no attribute 'geometry'

@banesullivan
Copy link
Contributor

banesullivan commented May 22, 2019

Hi @rminhxm - this issue looks like it might be on the omfvista-side rather than the OMF backend (this repository). Could you share a few more details to help me understand what's going wrong in this example?

Where exactly did you download the 'test_file.omf' file?

What is your version of omfvista, omf, and properties?

import omfvista, omf, properties
print('omfvista: ', omfvista.__version__)
print('omf: ', omf.__version__)
print('properties: ', properties.__version__)

@rminhxm
Copy link
Author

rminhxm commented May 22, 2019

Hi @banesullivan , thanks for looking into this. Here with more info:

  1. The test_file.omf is from this repository.
  2. The output of the versions
omfvista:  0.2.0
omf:  1.0.1
properties:  0.6.0b0

I followed the README guide and install all dependencies with pip.

@banesullivan
Copy link
Contributor

Thank you for sharing those details - I have reproduced this issue locally.

This appears to be the result of a change that is present on the master branch of OMF (this repo) which I haven't corrected in omfvista. I'll look in the commit history and see what I can do to update omfvista to reflect most recent changes to OMF

@banesullivan
Copy link
Contributor

To generalize this issue (adopted from the docs), the following example is failing when using the master branch of omf:

>>> import numpy as np
>>> import omf
>>>
>>> pts = omf.PointSetElement(
...     name='Random Points',
...     description='Just random points',
...     geometry=omf.PointSetGeometry(
...         vertices=np.random.rand(100, 3)
...     ),
...     data=[
...         omf.ScalarData(
...             name='rand data',
...             array=np.random.rand(100),
...             location='vertices'
...         ),
...         omf.ScalarData(
...             name='More rand data',
...             array=np.random.rand(100),
...             location='vertices'
...         )
...     ],
... )
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
AttributeError: module 'omf' has no attribute 'PointSetGeometry'

Immediate solution... revert to the stable version deployed on PyPI: pip install omf==1.0.1

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

No branches or pull requests

2 participants