Python Forum
help me with this libraries
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help me with this libraries
#1
hello
I have a code starting with "from Classes import LoadAtom , Atom"
and I cant get them installed on my python
pakages like numpy and scipy are installed
but not this one
code also contains:

----------------------------code-----------------------------------
from Classes import LoadAtom , Atom ?
from numpy import dot , transpose , conj , divide , sqrt , add , zeros , multiply ,\
round , sum , copy , argmax
from scipy . linalg . decomp import eigh
from numpy . linalg . linalg import solve
from numpy . core . umath import subtract
from MatrixFunctions_Atoms import BuildTotalMatrices ?
from Petersson_Hellsing import BuildAtomicMatrices ?
...
--------------------------------------------------------------------
Ive put a question mark at the end of lines I have problem with.
Please answer!
this is a student project
thank you for helping
Reply
#2
Are you sure they need to be installed? Everything else is a common package in python, those might just be files provided to you from the class.
Reply
#3
It work for me Think
λ ptpython
>>> from Classes import LoadAtom

>>> obj = LoadAtom()
>>> obj.foo
'hello'
I have of course cheated to get this to work.
It will be somewhat similar for you.
Example i have a file Classes.py in that file there can be 2 classes LoadAtom and Atom.
So this is local code that get imported and can work together with the other module you import.

My setup to get code over to work:
C:\Python36\Classes.py
In Classes.py:
class LoadAtom:
    foo = 'hello'
Reply
#4
Obviously OP has the code from http://www.aau.dk/digitalAssets/281/2815...ethods.pdf
see Annex 3
Reply
#5
(Jan-04-2018, 09:57 PM)buran Wrote: Obviously OP has the code from http://www.aau.dk/digitalAssets/281/2815...ethods.pdf
If it obvious can be discussed Confused
Think i have to read my mathematics learning book again,
but i guess it to basic for this Undecided
Reply
#6
The best thing to do is to obtain the code by emailing the article's authors.
Reply
#7
(Jan-04-2018, 09:53 PM)nilamo Wrote: Are you sure they need to be installed? Everything else is a common package in python, those might just be files provided to you from the class.

Im not really sure about anything!
but without installing them , an error occurs while runnig the code.

(Jan-04-2018, 09:54 PM)snippsat Wrote: It work for me Think
λ ptpython
>>> from Classes import LoadAtom

>>> obj = LoadAtom()
>>> obj.foo
'hello'
I have of course cheated to get this to work.
It will be somewhat similar for you.
Example i have a file Classes.py in that file there can be 2 classes LoadAtom and Atom.
So this is local code that get imported and can work together with the other module you import.

My setup to get code over to work:
C:\Python36\Classes.py
In Classes.py:
class LoadAtom:
    foo = 'hello'

Could you plz. be more specific, Im not good at python coding!
Reply
#8
(Jan-06-2018, 08:21 PM)Kiasheen Wrote: Could you plz. be more specific, Im not good at python coding!
You need to talk with your teacher to get the file that used for this import.
I have look in the PDF posted,no code for LoadAtom and Atom.
What you missing is a file called Classes.py that i guess contain two classes LoadAtom and Atom.

Same with this import.
from Petersson_Hellsing import BuildAtomicMatrice
So this is a file from T Petersson and B Hellsing,which you probably know who is when study in this field.
Reply


Forum Jump:

User Panel Messages

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