Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pyphs run error
#1
my question here
I recently installed pyphs package in python.
When I run the script, it shows import error: No module named phs


# inductor
inductor = {'dictionary': 'electronics',
           'component': 'inductor',
           'label': 'myL',
           'nodes': ('A', 'B'),
           'arguments': {'L': ('L1', 5e-2)}}
phs.graph.netlist.add_line(inductor)
Reply
#2
Please, post the relevant code (in code tags)- i.e. in this code snippet there is no import statement, as well as full Traceback in error tags.
Reply
#3
Sorry, for not providing full details,
I am trying to reproduce the example given in https://afalaize.github.io/pyphs/posts/inductor/

import pyphs
#inductor
inductor= {'dictionary':'electronics',
'component':'inductor',
'label':'myL',
'nodes':('A','B'),
'arguments':{'L':('L1',5e-2)}}
phs.graph.netlist.add_line(inductor)



the .net file is
electronics.inductor myL('A','B'):C=('L1',5e-2);


I am getting the error as

Traceback (most recent call last):
 File "script.py", line 8, in <module>
   phs.graph.netlist.add_line(inductor)
NameError: name 'phs' is not defined
Reply
#4
(Jun-02-2017, 01:21 PM)pournamy Wrote: phs.graph.netlist.add_line(inductor)
My guess would be this should either be pyphs.phs.graph... or pyphs.graph...
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#5
I think you should start from here
https://afalaize.github.io/pyphs/posts/tuto1/
note the
phs = pyphs.PortHamiltonianObject(label='RLC', path='label')
Reply
#6
When i am trying to do ,
phs=pyphs.PortHamiltonianObject(label='L', path='label')

I am getting an error as
AttributeError: 'module' object has no attribute 'PortHamiltonianObject'
Reply
#7
(Jun-02-2017, 07:59 PM)pournamy Wrote: When i am trying to do ,
phs=pyphs.PortHamiltonianObject(label='L', path='label')

I am getting an error as

[output][AttributeError: 'module' object has no attribute 'PortHamiltonianObject'/output]
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020