lanl / LaGriT

Los Alamos Grid Toolbox (LaGriT) is a library of user callable tools that provide mesh generation, mesh optimization and dynamic mesh maintenance in two and three dimensions.
https://lanl.github.io/LaGriT/
Other
116 stars 48 forks source link

'PyLaGriT' object has no attribute 'lagrit_exe' #172

Closed pinshuai closed 4 years ago

pinshuai commented 4 years ago

I was running the tinerator docker image on a remote server. I can import tinerator, but got the following error when I tried to load the example file.

Screenshot 2019-08-01 16 55 31

Any idea?

daniellivingston commented 4 years ago

Hi Pin - can you verify that the file ~/.pylagritrc exists?

pinshuai commented 4 years ago

Yes, this is the content.

lagrit_exe : "/home/jovyan//bin/lagrit"
daniellivingston commented 4 years ago

Interesting. Can you try running, either in Jupyter or in the REPL,

from pylagrit import PyLaGriT

lg = PyLaGriT()

If this is a PyLaGriT issue, which it seems to be, you should get the same traceback as above.

pinshuai commented 4 years ago

I did get the same error. Btw, I am running the notebook on a remote server like NERSC.

Screenshot 2019-08-09 16 11 20
daniellivingston commented 4 years ago

@dharp , can you look at this?

dharp commented 4 years ago

It looks like pylagrit is not finding your pylagritrc file. Try adding a lagrit_exe option to the PyLaGriT instantiation: lg = PyLaGriT(lagrit_exe=<path/to/your/lagrit/ext>). I added an check for a missing lagrit_exe in the code now that dumps a message with the above suggestion. Not sure why it isn't finding your ~/.pylagritrc, but this is a workaround for now.

dharp commented 4 years ago

Another thing to try is to put the .pylagritrc file in the directory where you are running the script. pylagrit will look in that location first before looking for it in your home directory. I'm wondering if it is possible that the terminal that you are running the script from does not know where your home directory is?

pinshuai commented 4 years ago

@dharp Sorry for the delay. Adding lagrit_exe=<path/to/your/lagrit/ext> did work for creating a Pylagrit object. However, tinerator wraps everything and I am not sure if I can add the path directly so tinerator knows where to find it.

I also tried putting ~/.pylagritrc file in both working dir and home dir, but no luck so far.

Is there a way I can hardwire the lagrit_exe path in the source code?

pinshuai commented 4 years ago

This bug has been fixed by using double quote in the path. #See #179