Skip to content

Kvec talks to isodistort #139

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

Open
wants to merge 353 commits into
base: master
Choose a base branch
from
Open

Kvec talks to isodistort #139

wants to merge 353 commits into from

Conversation

Kvieta1990
Copy link
Collaborator

@Kvieta1990 Kvieta1990 commented Feb 12, 2025

I added in the capability to communicate with the isodistort server after the k-vector search in GSAS-II. Once we get the searched k-vector table, we can select either of the k vectors in the table and click on the button to talk to isodistort.

Currently, I am only outputting all the CIF files corresponding to all the isotropic subgroups associated with the selected k vector. The next step will be to incorporate those CIF files into independent GSAS-II project file, which I may need help from @briantoby

N.B. For the moment, I am outputting all the CIF files into os.getpwd(). Not sure whether this is the optimal solution. Also, after the output is done, I am having a message box saying the job is done and include the output path in the message box. However, it seems the path in the message box would be wrapped up and I don't know the way to control the message box window size so that the path can be displayed in a single line.

Here is the file that we can use for testing and further development.
Ba6Co6_nuc_refine.gpx.zip

@Kvieta1990 Kvieta1990 added the enhancement New feature or request label Feb 12, 2025
@Kvieta1990 Kvieta1990 requested a review from briantoby February 12, 2025 16:38
@Kvieta1990 Kvieta1990 self-assigned this Feb 12, 2025
@briantoby
Copy link
Collaborator

The routine GSASIIphsGUI...OnApplySubgroups() shows code that creates multiple .gpx files.

  • Line 4168 saves the current project.
  • Then I delete sections of the project that would not be correct after the phase is updated (this is probably not needed if a magnetic phase will be added rather than replacing a phase).
  • The code inside the loop replaces the phase
  • Once the loop is done (line 4250) the .gpx file saved in 4168 is reread
  • The _ShowPhase routine opens the data tree to the previously displayed location so the user see the same info as previously displayed.

Note that G2frame.GSASprojectfile is the name of the current .gpx file and G2frame.LastGPXdir is the directory where that file was saved. There is also a path, G2frame.dirname but I'm really not sure what that is used for. At one time we tracked a directory where data would be read from (for example with tutorials). I'm not sure if that still works, but that might be what G2frame.dirname is all about.

@briantoby
Copy link
Collaborator

As far as message box goes, I think you are referring to wx.MessageBox which is somewhat unpredictable. It uses a native widget to Linux, Windows and Mac can all behave differently (and probably different on different flavors of Linux.) To deal with that, I plan to change GSASIIctrlGUI.G2MessageBox to create its own window, but I have not gotten around to that.

You can use GSASIIctrlGUI.ShowScrolledInfo, where you can control the size of the window (but it does wrap text that is too wide for the supplied width). It would not be that hard to add an option to ShowScrolledInfo to turn off text wrapping or perhaps a routine to create a window that scrolls and does not wrap. I don't think one would want to make the window expand to fit the text (in case the text is really long).

@Kvieta1990
Copy link
Collaborator Author

Thanks a lot Brian for your comments! I will work further on this branch and I will let you know when the PR is ready for you to check again before merging into master. Thanks!

@briantoby
Copy link
Collaborator

If you need any help, please ask

tacaswell and others added 15 commits February 19, 2025 17:51
* BLD: do not track build product

* BLD: add pycifrw dep to pyproject.toml

* BLD: be forgiving about a detached head

This happens on CI

* keep git_version.py file; but have build create an alternate ignored file (saved_version.py)

* BLD: get generated executables into install-editable pixi install (assumes a lot w/r path names)

* BLD: remove broken windows build from self-test suite

---------

Co-authored-by: BHT <toby@anl.gov>
Not sure why Bob's changes did not get into last merge
RJCD-Diamond and others added 5 commits June 12, 2025 13:45
Fixed and replaced xrange with range in NIST_profile/profile_functions_class.py
Fix GSASIIscriptable via update to profile_functions_class.py. Alas, I just learned that Marcus is no longer with us, sigh, so I will just have to accept this change.
Merge remote-tracking branch 'origin/main' into kvec_isodistort_zyp
@briantoby
Copy link
Collaborator

I have made changes but was prepared to test them. I think this will now rename the phase properly in the data tree for the created .gpx files. Please let me know if there are any non-obvious bugs that I have created

vondreele and others added 20 commits June 17, 2025 14:28
Add option to save as csv file the bond/angle distributions from RMCProfile result
so that it is ready to merge into main as a FF
@Kvieta1990
Copy link
Collaborator Author

Hi @briantoby Just a quick update on this. I have been working on the tutorial concerning this PR. As I am working on this, I found something more on the implementation side to work on,

  • Isodistort server seems to be updated and some of the URL no longer works. Fortunately the change on the isodistort side is pretty consistent so the adjustment the GSAS-II side is not that much.
  • For the tutorial, I was using a cubic system and when using it for talking to the isodistort server, I realize that the parameters that we need to pass to the isodistort server are dependent on the crystal system since the name for the k vector passed to isodistort will change. This means I may have to create an exhaustive list of those k vector names for all the possible cases. Or, possibly, I can try to see whether we can extract such a list from isodistort intermediate output.
  • For specific crystal systems, e.g., the cubic one I was playing around with now, some of the k-vectors are equivalent, e.g., (1/2,0,0) is equivalent to (0,1/2,0) and (0,0,1/2). By default, isodistort only lists out one of them and this is also something we need to adapt to, according to their convention.

It may take some time longer than I was expecting, but I will try my best to do this as soon as I can.

@Kvieta1990
Copy link
Collaborator Author

turns out I have a lot to work on...we can talk about this tomorrow and I will show you what the problem is and my intended solution (which needs a lot of work).

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

Successfully merging this pull request may close these issues.

5 participants