qpv-research-group / solcore5

A multi-scale, python-based library for the modelling of solar cells and semiconductor materials
https://www.solcore.solar/
Other
133 stars 77 forks source link

S4.New() #249

Closed moses-varghese closed 1 year ago

moses-varghese commented 1 year ago

when I try to use the RCWA to determine the EQE I encounter an issue with S4.New() as it says: AttributeError: module 'S4' has no attribute 'New'

phoebe-p commented 1 year ago

Hi, could you give some more information - what operating system are you using? Did you encounter any issues during S4 installation?

are you trying to run a file from inside the same folder where your downloaded S4? If there is a local folder called “S4”, Python could be trying to import locally instead of from the installed package

moses-varghese commented 1 year ago

When I try to run a file outside S4 I am unable to import S4. How do I install S4 as a package and call it in another file? I tried to install S4 by: make S4_pyext Is there something else we need to update?

phoebe-p commented 1 year ago

Ok, you should be running it in a different folder (local importing will not work). Did you follow the installation instructions here? https://github.com/phoebe-p/S4

Did the installation seem to complete successfully? And what operating system are you using?

phoebe-p commented 1 year ago

The instructions here https://rayflare.readthedocs.io/en/latest/Installation/installation.html may also be helpful

moses-varghese commented 1 year ago

Yes, I followed the same instructions. I am using ubuntu.

phoebe-p commented 1 year ago

What is the final bit of output in the terminal when you run make S4_pyext? Have you installed S4 and Solcore in the same Python environment you are using to run the code?

moses-varghese commented 1 year ago

Thank you for the help. It was an issue with the environment and package installation and solved it with correct installation and python environment.