Skip to content
New issue

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

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

Already on GitHub? # to your account

Kvec talks to isodistort #139

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

Kvec talks to isodistort #139

wants to merge 8 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

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

Successfully merging this pull request may close these issues.

2 participants