-
Notifications
You must be signed in to change notification settings - Fork 28
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
Problem with run_ray_tracing #159
Comments
There are two underscores before and after "file" |
What is printed by |
My python version is 3.8.3.
Somehow I solved this problem by modifying xrt/runner.py.
In line 566:
mod = inspect.getmodule(frm[0])
I removed the "[0]" behind "frm". Since I noticed that in the previous line
frm = inspect.stack()[1]
, inspect.stack() returns a single FrameInfo object but not a list.
Maybe it is related to the version of python.
Thanks a lot!
Konstantin Klementiev ***@***.***> 于2023年10月17日周二 17:15写道:
… What is printed by python --version?
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCKY6V4BAGN5KF52PKTX7ZECXAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRWGAYDOOJSGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
According to the documentation, a list of FrameInfo is returned starting from version 3.5. Don't know what is the problem here but I'll put an extra check there. Please try (the two middle lines are inserted):
Thank you for reporting it! |
Thanks a lot for your reply. I added the two lines as you suggested.
I have a few other probably related questions.
1. When I used run_ray_tracing to generate XYCplots of some screen in a
beamline, sometimes I get plots with only dark background and no contents
in it. This is the case when I run e.g.
examples\withRaycing\05_QWP\04_collimated_LT.py . But sometimes it works,
e.g. for a simplest beamline code generated by xrtQook (following the
tutorial in https://xrt.readthedocs.io/qook_tutorial.html#qook-tutorial).
2. The gui of xrtQook does not show any graph. All the buttons are empty
without figures in them, although the software itself is working.
I am not sure whether these problems are independent or related to each
other. Maybe there is something not compatible with my local envirionment?
I have tried to either run the scripts in Spyder or in a JupyterLab.
Konstantin Klementiev ***@***.***> 于2023年10月18日周三 15:08写道:
… According to the documentation
<https://docs.python.org/3/library/inspect.html#inspect.stack>, a list of
FrameInfo is returned starting from version 3.5.
Don't know what is the problem here but I'll put an extra check there.
Please try (the two middle lines are inserted):
mod = inspect.getmodule(frm[0])
if mod is None:
mod = inspect.getmodule(frm)
runfile = mod.__file__
Thank you for reporting it!
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCO6A5IVODYDQHGC5BLX756AVAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRXHAYDMOBZGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
When in Spyder, try to run it in external system terminal. |
For xrtQook, I did not run it in Spyder. Just ran python xrtQookStart.pyw at
xrt/gui.
Konstantin Klementiev ***@***.***> 于2023年10月18日周三 15:49写道:
… When in Spyder, try to run it in external system terminal.
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCOP67XJVP647TONW6TX76CYXAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRXHA3TSNRRGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
What happens if you unzip the GitHub xrt package to any user location and run xrtQookStart.pyw from there? |
Yes. That's what I did. I unzipped the package in some directory in my D:
disk and ran xrtQookStart.pyw in xrt/gui by command-line terminal without
using Spyder.
Konstantin Klementiev ***@***.***> 于2023年10月18日周三 16:55写道:
… What happens if you unzip the GitHub xrt package to any user location and
run xrtQookStart.pyw from there?
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCLWQEU5SJP2T6S3HHTX76KRFAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRXHE4TINRSGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I suspect you have several versions of xrt. Start python from your working directory and type
Is the library location where you expect it to be? If not, delete it from there and try again. |
Thanks a lot! Indeed there is another xrt installed. After deleting that
one, now the gui of xrtQook looks good.
However, the problem that XYCplot generates empty figures persists. It is
the case when I simply run examples\withRaycing\05_QWP\04_collimated_LT.py
, for example. There is no traceback but the figures only have a black
background.
Could you please also help to point out possible reasons? Thanks a lot!
Konstantin Klementiev ***@***.***> 于2023年10月18日周三 20:35写道:
… I suspect you have several versions of xrt. Start python from your working
directory and type
>>> import xrt
>>> xrt.__file__
Is the library location where you expect it to be? If not, delete it from
there and try again.
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCMUWGAAM2BWWSZF5TTX77EJFAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRYGM2TSNJTGY>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Do you get a single iteration ready? (when you see values for N_all, N_good and Flux) |
I think I did not see the values of N_all, N_good and Flux.
Originally processes='half'. When I changed it to processes=1, I saw no
change of the output. It just outputs some information about the last 10
runs, such as start/stop time, duration, etc. And then the empty figures.
Konstantin Klementiev ***@***.***> 于2023年10月18日周三 22:30写道:
… Do you get a single iteration ready? (when you see values for N_all,
N_good and Flux)
Try processes=1 in xrtr.run_ray_tracing(plots, repeats=24, ...)
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCMR5YPY4MZZDOCXZHDX77RYHAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRYGU4TENZVHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Do you see an increased load in a system monitor? |
No obvious change in the system monitor. When I ran the script, only the
CPU occupation increased a little for a moment (from ~5% to ~15%). The
empty figures came out really fast after running the script.
Konstantin Klementiev ***@***.***> 于2023年10月19日周四 00:11写道:
… Do you see an increased load in a system monitor?
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCIRXPC5REIJBJPWV33X775SPAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONRYHA3DOMJQHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I think that the problem with |
Thanks a lot. I will reinstall python soon and see whether it works.
Konstantin Klementiev ***@***.***> 于2023年10月19日周四 15:26写道:
… I think that the problem with inspect is indicative of a corrupt python
installation. The easiest solution is to install the latest WinPython and
forget all the troubles.
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCP6FNPDFYOVE45NWY3YADI2DAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGIYTQMRUHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Unfortunately, it still does not work after reinstalling my python (3.12.0)
and spyder.
What more can I do?
yj zhang ***@***.***> 于2023年10月19日周四 15:30写道:
… Thanks a lot. I will reinstall python soon and see whether it works.
Konstantin Klementiev ***@***.***> 于2023年10月19日周四 15:26写道:
> I think that the problem with inspect is indicative of a corrupt python
> installation. The easiest solution is to install the latest WinPython and
> forget all the troubles.
>
> —
> Reply to this email directly, view it on GitHub
> <#159 (comment)>, or
> unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BDKPXCP6FNPDFYOVE45NWY3YADI2DAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGIYTQMRUHE>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
I think the problem is not with python version but rather with proper package management. With WinPython you get a portable system that doesn't need system paths, you can move it to any location, just run its command line shell and you have all the definitions inside. If you want to go a hard way of fixing broken paths and dependences inside your python installation, nobody can help you. |
Thanks a lot.
Now I installed WinPython 3.11 and ran the scripts. It successfully worked
in the command prompt. However, in Spyder and Jupyter notebook, the problem
of empty figures persists. Interestingly, in Jupyter notebook, the problem
of inspect occurred again.
I copied the xrt into the WinPython notebooks folder and imported xrt from
there to run it in Jupyter notebook. I noticed that in the command prompt I
can cd to the folders outside the Winpython folder, but in Jupyter I could
not go outside the notebooks folder.
Probably it also have something to do with my hardware. When I successfully
ran it in command prompt, the computer is significantly slowing down. Maybe
there will cause some problem when switching to Spyder or Jupyter.
Anyway, I can now work with the command prompt and proceed.
Thanks again for your kind help!
Konstantin Klementiev ***@***.***> 于2023年10月25日周三 18:20写道:
… I think the problem is not with python version but rather with proper
package management. With WinPython you get a portable system that doesn't
need system paths, you can move it to *any location*, just run its
command line shell and you have all the definitions inside. If you want to
go a hard way of fixing broken paths and dependences inside your python
installation, nobody can help you.
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCPAZBJ4ND6A2KLX7T3YBDRX7AVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZYHE2TIMBUGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Make sure you start the WinPython's Spyder, not your previous Spyder version. Spyder's IPython console is not compatible with multiprocessing. So if you want multiprocessing, select the run option "Execute in an external system terminal". |
Yes. I started Spyder in the WinPython folder, but the figures are still
empty. Maybe there is still something wrong.
Konstantin Klementiev ***@***.***> 于2023年10月26日周四 16:16写道:
… Make sure you start the WinPython's Spyder, not your previous Spyder
version. Spyder's IPython console is not compatible with multiprocessing.
So if you want multiprocessing, select the run option "Execute in an
external system terminal".
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCM2S3ITQHDIGJUSDMDYBIL7BAVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBQGYZTEMJQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
How about running the script in an external system terminal (but still from Spyder)? |
Somehow it also worked... Then probably the problem is in Spyder itself...
Konstantin Klementiev ***@***.***> 于2023年10月26日周四 17:36写道:
… How about running the script in an external system terminal?
—
Reply to this email directly, view it on GitHub
<#159 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDKPXCOJLA2VPGNAK4ELEMLYBIVK7AVCNFSM6AAAAAA6DIEFFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBQG43DCMBYGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I am a beginner of xrt. I try to run an example script but encountered a problem. It occurs during calling the xrt.runner.run_ray_tracing function. In the line
runfile = mod.file
, it reports AttributeError: 'NoneType' object has no attribute 'file'
Could anybody help about this issue? Thanks a lot!
The text was updated successfully, but these errors were encountered: