-
Notifications
You must be signed in to change notification settings - Fork 31
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
Exceptions in thread during Convolve gets stuck waiting for results instead of throwing an error in the main function call #179
Comments
thanks for the report.
Can you specify: platform, python version? Does the problem appear also if running with less processes? Do you set any special settings on the |
I am working in Ubuntu 20.04.6 (through WSL) and use Python 3.10.13 and xrayutilities 1.7.6. I don't think I use any special settings. Here is the code snippet I use for generating the diffraction:
I haven't tried running with less processes. What argument should I use to do that? |
Ok, with your code snippet I can reproduce the problem. What I observed so far: I get the error with the structure from your cif file.
with the output:
This seems to be deep in the code which was contributed. I try to inquire if the original author can identify the issue quicker. |
The problem lies in some debugging code I left in the axial_helper_function a long time ago. At line 733 powder.py is a block of code which does a relative error check to look for accidental negative intensities coming from roundoff errors. It happens that something in the setup (maybe computing very far into the wings of peaks) is putting the calculation into a region of extremely weak absolute intensity, so tiny absolute errors are large relative errors. The error that begins with:
shows the intensity array with intensities of 1e-11 and below. For the interim, you could just delete the lines starting at 733:
I will think about a more elegant solution soon. Doing this, and plotting, gives me: |
This implements the suggested fix by @mendenmh.
I think it can be merged.
Marcus Mendenhall
Materials Measurement Science Division
National Institute of Science and Technology
100 Bureau Dr. stop 8370 (217/B115)
Gaithersburg, MD 20899 USA
Phone: +1-301-975-8631
… On May 22, 2024, at 2:48 AM, Dominik Kriegner ***@***.***> wrote:
@mendenmh Is the fix implememented in #181 worth merging? Or do you think you will have a better fix soon? I am asking because I might do a release again soon when I set up building with numpy 2.0.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This implements the suggested fix by @mendenmh.
In cases where the given 2 theta range is too broad, an IndexError will be thrown in the thread spawned for Convolve. However, this error does not get thrown in the main process and the PowderModel.simulate function call will therefore keep waiting for a result of the convolution.
Exception from the thread:
Error after manually killing the process:
Error can be reproduced using this cif file (format changed to .txt for compatability with GitHub) when simulating scattering in a 2 theta range from 5 to 80.
qmof-4148b62.txt
The text was updated successfully, but these errors were encountered: