mretegan / crispy

Core-Level Spectroscopy Simulations in Python

Home Page:http://www.esrf.eu/computing/scientific/crispy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Notebook calc.run() Error

WilliamJudge94 opened this issue · comments

commented

After following the notebook tutorial found at https://www.youtube.com/watch?t=1123&v=ovdLJXIqMEE&feature=youtu.be, I was unable to run the command calc.run(). I received the error in the attached image.

Crispy Version = 2020.1rc0
Python Version == 3.7

Screen Shot 2021-01-21 at 12 27 35 PM

commented

I believe the issue lies with crispy.config.Config.loadDefaults() never gets called inside the crispy.gui.quanty.calculation.Calculation() function. This is where you initially set the "CurrentPath" to os.path.expanduser("~")

crispy.gui.quanty.calculation.Calculation() is the main function of crispy.notebook.calculation. Because loadDefaults() is never called, this leaves settings.value("CurrentPath")=None.

I am unsure if this is the full extent of the problem, but I figured I would leave a comment on what I learned from looking at the code.

commented

This is exactly the issue. I got the notebook version of crispy working by doing the following:

  1. adding this bit of code after "settings = Config().read()" in crispy.gui.quanty.calculations.py
settings.beginGroup("Quanty")
settings.setValue("Verbosity", "0x0000")
settings.setValue("DenseBorder", "2000")
settings.setValue("RemoveFiles", True)
settings.endGroup()
  1. adding this bit of code to the same file, but farther down. To be placed in the already defined function executablePath(self): THIS IS NOT THE WHOLE FUNCTION. Just an example of what to add right at the beginning of the function.
def executablePath(self):
    path = Config().read().value("Quanty/Path")
    path = '/path/to/Quanty'`

@WilliamJudge94 thanks for the having a look at this. The problem was indeed related to "settings.ini" not being created. I've pushed some changes to the code, and it should all work now.