Skip to content

Conversation

@romainmartinez
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented Jun 6, 2020

Pull Request Test Coverage Report for Build 04dba035bcb3170b7bfed3e2ce0895e9a6a36ea5-PR-99

  • 9 of 9 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 98109e23e85a949b66099675ea112d9fcae74b60: 0.0%
Covered Lines: 652
Relevant Lines: 652

💛 - Coveralls

pariterre
pariterre previously approved these changes Jun 6, 2020
Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

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

LGTM

@pariterre
Copy link
Member

@romainmartinez
After testing locally, this still doesn't work... Strangely enough, if I copy the pyomeca folder into site-package, it works. But if it is install from pip or python setup.py, if fails to load analogs.py:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pariterre/Programmation/miniconda3/envs/rbdlCasadi/lib/python3.8/site-packages/pyomeca/__init__.py", line 1, in <module>
    from .analogs import Analogs
  File "/home/pariterre/Programmation/miniconda3/envs/rbdlCasadi/lib/python3.8/site-packages/pyomeca/analogs.py", line 8, in <module>
    from .io import read, utils
ModuleNotFoundError: No module named 'pyomeca.io'

even though the line 8 reads from .io (I changed it locally)

@pariterre
Copy link
Member

Okay, just found the problem, with the command to install, only the main folder is copied, but not the subfolder, so ".io" is actually not there

It does not work with python setup install, but it does with pip install .
@pariterre
Copy link
Member

@romainmartinez
Please review that. Keep in mind that it may not be the proper solution, since python setup.py install won't work using this method...

@romainmartinez
Copy link
Member Author

Found a proper solution 😃

  1. Added __init__.py in subdirectories (0d2d40a)
  2. Used find_packages() in setup.py (77d413f)
  3. Kept importing class that are defined in the root __init__.py (1f0077e)

it works locally using python setup.py install.
Please review @pariterre.

import xarray as xr

from .angles import Angles
from pyomeca import Angles
Copy link
Member

Choose a reason for hiding this comment

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

Does this may cause problem if ones has a pyomeca installed, but also has imported the folder (as a symbolic link for instance)?

from scipy.optimize import least_squares

from ..angles import Angles
from pyomeca import Angles
Copy link
Member

Choose a reason for hiding this comment

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

Idem as next comment (if the answer is no, then you can merge! You will have to do another release so I can update the conda PR)

@romainmartinez romainmartinez merged commit 901eae5 into pyomeca:master Jun 7, 2020
@romainmartinez romainmartinez deleted the fixing-import branch June 7, 2020 21:24
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.

3 participants