GithubHelp home page GithubHelp logo

Comments (11)

afalaize avatar afalaize commented on June 9, 2024

Ok. Thank you for feedback. I Will search for known issues when porting python code from mac OSX to windows 10.
Which pyphs version are you using? You can get it with
import pyphs
pyphs.__version__

from pyphs.

TristanLbrn avatar TristanLbrn commented on June 9, 2024

I am using 0.1.8
Somehow I get the same error with Linux (Debian 8) and pyphs 0.1.8 :

Code

import pyphs
PHS = pyphs.PortHamiltonianObject(label='label', path='path')

Error

Traceback (most recent call last):

  File "<ipython-input-27-96d64029112b>", line 2, in <module>
    PHS = pyphs.PortHamiltonianObject(label='label', path='path')

  File "xxxx/.local/lib/python2.7/site-packages/pyphs/pyphs.py", line 93, in __init__
    from symbolics.symbols import Symbols

ImportError: No module named symbolics.symbols

from pyphs.

afalaize avatar afalaize commented on June 9, 2024

Ok. It seems like the import method of submodules does not work. I changed the following in the development branch:
from symbolics.symbols import Symbols
to
from .symbolics.symbols import Symbols
to force the submodule search in the pyphs path.

Please, do the following:

  1. get the latest version on the dev branch of pyphs,
  2. with terminal, go in that root folder (that contains both a "setup.py", the "README.rst", and a "pyphs" folder),
  3. run a local PiP installation with:
    pip install -e .
  4. in python, verify the pyphs version is "0.1.9b6_DEV"
  5. test if it this commit solves the import of submodules.
    Thank you!

from pyphs.

TristanLbrn avatar TristanLbrn commented on June 9, 2024

Thank you, the local installation of the latest version completed successfully.

Unfortunately I get the same error (Debian 8) :
Code

import pyphs
print(pyphs.__version__)
PHS = pyphs.PortHamiltonianObject(label='label', path='path')

Output

0.1.9b6_DEV
Traceback (most recent call last):

  File "<ipython-input-4-1b4ee30b4c7e>", line 1, in <module>
    runfile('xxxx/test.py', wdir='yyy')

  File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 580, in runfile
    execfile(filename, namespace)

  File "xxxx/script.py", line 10, in <module>
    PHS = pyphs.PortHamiltonianObject(label='label', path='path')

  File "xxx/.local/lib/python2.7/site-packages/pyphs/pyphs.py", line 93, in __init__
    from .symbolics.symbols import Symbols

It seems that all paths have to be addressed in an absolute way : from pyphs.symbolics.symbols import Symbols

from pyphs.

afalaize avatar afalaize commented on June 9, 2024

I suspect a deepest problem.
However, to oust this question, please can you try the latest version on the dev branch of pyphs, which should be "0.1.9b7_DEV"? (same procedure as above). This last commit includes your solution:
from pyphs.xxx import blablabla
But, I would worry if it works...

from pyphs.

TristanLbrn avatar TristanLbrn commented on June 9, 2024

I installed this new version, but I still get the same result.
Here are the contents of the installed package :

help(pyphs)
Help on package pyphs:

NAME
    pyphs

FILE
    XXXX/.local/lib/python2.7/site-packages/pyphs/__init__.py

PACKAGE CONTENTS
    config
    metadata
    paths
    pyphs

I wonder if the modules (Symbolics, plots ...) are included in the package ? Should they appear explicitly in the package contents ?

Note : I don't know if that makes a difference, but I have used the following code for the installation (instead of pip -e) :
pip install --user XXXX/pyphs-dev.zip

from pyphs.

TristanLbrn avatar TristanLbrn commented on June 9, 2024

Maybe this stack overflow question could help.
This topic states that sub-packages should be declared in the setup.py file.

from pyphs.

afalaize avatar afalaize commented on June 9, 2024

Sounds good!
We should have a look to this reference which is pointed in the above stack overflow question.

from pyphs.

afalaize avatar afalaize commented on June 9, 2024

I made the appropriate changes in the last commit in the dev branch with version "0.1.9c0_DEV"
Hope it will close this issue

from pyphs.

TristanLbrn avatar TristanLbrn commented on June 9, 2024

It works well !
Good job !

Code

import pyphs
dlc = pyphs.PortHamiltonianObject(label='dlc', path='label')
dlc.build_from_netlist('dlc_netlist.net')
dlc.texwrite()

Output

*** Realizability analysis succeed ***

from pyphs.

afalaize avatar afalaize commented on June 9, 2024

Thank you for finding the issue, and the solution!

Issue closed

from pyphs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.