xraypy / xraylarch

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging, and more.
https://xraypy.github.io/xraylarch
Other
127 stars 62 forks source link

[Larix/feff fitting] plot each path not working under Windows (Larch 0.9.78) #515

Open nams-549 opened 1 month ago

nams-549 commented 1 month ago

I updated larch and now larix isn't working. How do I resolve?

newville commented 1 month ago

@nams-549 well, that probably depends on what the problem is.

What operating system are you using? What you did to install, update, or try to run the program? Were there any error messages?

One possibility (though maybe not the best one) would be to delete the installation folder completely and reinstall from the installer.

nams-549 commented 1 month ago

Hii, Thank you very much for replying. Sorry for not being clear on the previous message. I'm using windows 11. I faced the issue once I updated larch to the newer version. I updated running the code provided for "Update Larch". Then I deleted and reinstalled the software.

Now it works fine except the "plot each path " command in the feff fitting tab. The command doesn't seem to work .This feature was very helpful to track the contribution of each path and now I'm unable to use it.

image

And in the "feffit tab" I'm not able to plot nor change the plot type. image

I didn't face any of these issues before I updated the software. Could you please suggest on how this can be resolved?

maurov commented 1 month ago

@newville I got a couple of reports from Windows users (with Larch 0.9.78) about an error plotting each path happening at this line:

https://github.com/xraypy/xraylarch/blob/570630ff84cbb16c36b1a8117f645659a6daaeea/larch/wxxas/feffit_panel.py#L1279

I have only the following trace from a user:

NameError: name 'paths' is not defined. Did you mean: 'xpath'?
 Traceback (most recent call last):
   File "D:\Users\lacom\xraylarch\Lib\site-packages\larch\wxxas\feffit_panel.py", line 1171, in
onPlot
     self.plot_feffit_result(dataset_name, topwin=topwin, **opts)
   File "D:\Users\lacom\xraylarch\Lib\site-packages\larch\wxxas\feffit_panel.py", line 1237, in
plot_feffit_result
     for i, label in enumerate(paths.keys()):
                               ^^^^^
 NameError: name 'paths' is not defined. Did you mean: 'xpath'?

But I cannot reproduce it under Linux and latest master version.

Any further idea?

newville commented 1 month ago

@maurov @nams-549 Yes, this is fixed in the master branch. A warning about that though: I have been playing with the ability to plot a sum of paths (and individual paths) without data. I believe this is now working, but I changed a lot of code in this area (in feffit_panel.py). I have tested it on some real examples but feel like I should probably test it more before all of that is released again.

tuheihei commented 4 weeks ago

@maurov @nams-549 Yes, this is fixed in the master branch. A warning about that though: I have been playing with the ability to plot a sum of paths (and individual paths) without data. I believe this is now working, but I changed a lot of code in this area (in feffit_panel.py). I have tested it on some real examples but feel like I should probably test it more before all of that is released again.

@newville Hi, Newville, may I ask how to get this bug fixed? I installed Larch from conda-forge. Should I just wait for another release? Thanks

newville commented 4 weeks ago

You can do a pip install of the nightly builds, as described in the documentation.

josephzsombor commented 3 weeks ago

I'm having this issue in Linux too. Just installed the most recent version.

newville commented 3 weeks ago

@josephzsombor Yeah, sorry. This is fixed in the nightly build. See https://xraypy.github.io/xraylarch/installation.html#installing-the-development-version