Open maurov opened 4 months ago
@maurov Yeah, sorry, I should have updated #496.
I added arguments to larch.io.save_session()
(https://github.com/xraypy/xraylarch/blob/master/larch/io/save_restore.py#L69)
to give a limited list of "symbols", and also to modify the history buffer. There is an auto_xasgroups
to create a corresponding _xasgroups
dict: Groups that have both a "filename" (the string to display as "this data set") and "groupname" (the name of the Python object), will then be included (_xasgroups
being {filename: groupname}).
I really wanted to get a release out (it's been too long, but things are very busy at the beamlines this month), but the plan here is to be able to save Partial Sessions, especially for auto-generating scripts and Jupyter Notebooks. That is, the hard part of "we did Feffit/Pre-edge Peak Fit/etc, now save a Jupyter Notebook" is actually "where did the data come from. And, I think that for the Jupyter Notebooks, if there is a cell that is "read the data into a group and do the processing to get chi(k)/Normalized Mu(E)/etc", that we can separately document/show how to do that, but have the auto-generated notebooks save a corresponding mini-session ".larix" file, and then read from that.
Also: for separating XAS and "Raw Data", I renamed that "XY Data", and most of the code is refactored from "xdat/ydat" to "xplot/yplot" (because most parts of the code use those only for plotting). It took a while to get that refactoring stable, and I did a lot of testing by hand. I think I tested all the panels, but I probably missed something.
Also: I did a lot of testing with Linux with Gtk3. The GUI layouts needed a lot of tweaking for font sizes and "up/down" buttons for numbers. These now look much better for me (Redhat 9), but let me know if you see issues.
Does that all seem OK to you??
Also, I think the Larch developer's meetings are on Summer Vacation (and APS-upgrade panic). Do you agree? But, if you want to chat, let me know!
@newville thanks for the update and the latest release. Everything seems OK to me, it is great, thanks! I was just doing some cleaning of the open issues, otherwise I get lost. We will further discuss after summer.
Originally posted by @newville in https://github.com/xraypy/xraylarch/issues/496#issuecomment-2007040466
@maurov Yep, I understand, just have not gotten that done yet. But also, if you look at that example and the
save_session
code at https://github.com/xraypy/xraylarch/blob/master/larch/io/save_restore.py#L69. it is probably not that hard, though maybe we want to break that function apart.Making a session by hand would "just be" creating a "config" section, a "command history" section (that could be empty) and then a "symbol table" - a Group of datasets and Groups, and with the important
_xasgroups
group for Larix to map "displayed file name" to "group name". And then using the "encode4js" function as insave_session
. Again, we could think about breaking that up so it did not assume a Larch session. For example, currently "Sesssion" is just a namedtuple, but it could be turned into a class with load/save methods.For Larix to be able to work with a Group, it is probably important to check that it has arrays called "xdat", "ydat", "energy" and "mu". It might also assume some other data that normally would be generated with the "install group" method.....
I may have time to work on this today, but I'm not certain.