Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Plot Selected Groups" not working after import Larch session using "Read Larch Session" #526

Closed
rarivera10 opened this issue Aug 6, 2024 · 9 comments

Comments

@rarivera10
Copy link

After I import a previously saved Larch session using "Read Larch Session", if I try to plot multiple groups, then nothing plots and I receive an error in the terminal saying:

Traceback (most recent call last):
File "C:\Users\rariv\xraylarch\lib\site-packages\larch\wxxas\xasnorm_panel.py", line 586, in onPlotSel
trace = {'xdata': dgroup.xplot,
AttributeError: 'Group' object has no attribute 'xplot'

This did not happen before updating to 0.9.80 on Windows.

If I open new data files from CSV and I plot multiple groups, then things work normally however.

@newville
Copy link
Member

newville commented Aug 6, 2024

@rarivera10 Oh, sorry for the trouble. Can you send a session file that shows this?

@rarivera10
Copy link
Author

Yes! Github doesn't let me attach a .larix file so I sent the file in an email to newville@cars.uchicago.edu.

@newville
Copy link
Member

newville commented Aug 7, 2024

@rarivera10

I believe this is fixed in the "development version", which you should be able to install with

   python -m pip install https://millenia.cars.aps.anl.gov/xraylarch/downloads/xraylarch-latest-py3-none-any.whl

On Windows: Open a command terminal (with “cmd” in the Start Menu’s search box). This should put you in a folder like
C:\Users\yourname
There should be a folder called xraylarch there. If not, check the properties of the Desktop icons for where xraylarch is installed. Once that is found, you can then you can type:

     xraylarch\python -pip install https://millenia.cars.aps.anl.gov/xraylarch/downloads/xraylarch-latest-py3-none-any.whl

@rarivera10
Copy link
Author

Downloaded and I receive a new error now:

Traceback (most recent call last):
File "C:\Users\rariv\xraylarch\lib\site-packages\larch\wxxas\xasnorm_panel.py", line 586, in onPlotSel
'ydata': getattr(dgroup, yarray_name) + ix*voff,
AttributeError: 'Group' object has no attribute 'norm_mback'

When normalization is set to mback on a group and I try to plot multiple groups, then I receive this error. However, plotting multiple groups with polynomial normalization works great. Mback works fine when I plot current group, I only see the problem when plotting multiple groups and one of them uses mback for normalization.

Thankfully, I only need polynomial normalization but figured I'd report the mback error as well since I stumbled upon it.

Thank you for your help!! I have enjoyed using Larix and am excited for the improvements you continue to make to the software.

@newville
Copy link
Member

newville commented Aug 7, 2024

@rarivera10 Thanks for the report and sorry for that. That's clear enough that I'll look into (maybe in a couple of days).

@maurov
Copy link
Member

maurov commented Aug 8, 2024 via email

@newville
Copy link
Member

newville commented Aug 8, 2024

@maurov Thanks, that's helpful, and I agree these must be related... hope to fix soon!

@newville
Copy link
Member

@rarivera10 @maurov I think this is fixed in the master branch. I fixed the code to check for the arrays from mback, and run that if needed (and be more aggressive about running mback n general), and I wasn't able to make it happen. But, I'm not certain I was trying every possible approach. If you are up for trying as with

 https://xraypy.github.io/xraylarch/installation.html#installing-the-development-version

let me know if this is still happening for you.

@rarivera10
Copy link
Author

Everything appears to be working well for me now. Will update if I run into the issue again. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants