Closed aps-7bm closed 1 year ago
Thanks for this, interestingly, make_stepanov
fails for me with HTTPError: HTTP Error 403: Forbidden
. Can you share a concrete command which worked for you?
Tomas, My command is: from syris.materials import make_stepanov fuel_material = make_stepanov('C12H26', energies, density=0.745 * q.g / q.cm **3) If I run this command with your version of the software, I get an error (I can't remember if it's 403 or 404). If I run it with mine, it works. What command were you running that worked with your version of the code? Thank you for the prompt response to my pull request.
Alan
On Thu, May 4, 2023 at 7:05 AM Tomas Farago @.***> wrote:
Thanks for this, interestingly, make_stepanov fails for me with HTTPError: HTTP Error 403: Forbidden. Can you share a concrete command which worked for you?
— Reply to this email directly, view it on GitHub https://github.com/ufo-kit/syris/pull/15#issuecomment-1534655701, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOHRULL5X4PH4X7SJXLZ3TXEOLQLANCNFSM6AAAAAAXUTDLOY . You are receiving this because you authored the thread.Message ID: @.***>
For me it works with neither original neither yours. Try this script:
import logging
import numpy as np
import quantities as q
import syris
from syris.materials import make_stepanov
syris.init(loglevel=logging.DEBUG)
energies = np.arange(10, 50) * q.keV
fuel_material = make_stepanov('C12H26', energies, density=0.745 * q.g / q.cm **3)
For me it gives:
# Some output which is not relevant and then this
2023-05-05 14:27:06,714 - syris.materials - DEBUG - https://x-server.gmca.aps.anl.gov/cgi/x0h_form.exe?xway=2&wave=10.0&coway=2&chem=C12H26&rho=0.745&i1=1&i2=1&i3=1&df1df2=-1&modeout=1
Traceback (most recent call last):
File "material_creation.py", line 9, in <module>
fuel_material = make_stepanov('C12H26', energies, density=0.745 * q.g / q.cm **3)
File "/home/tomas/virtenvs/syris/lib/python3.8/site-packages/syris-0.4.dev0-py3.8.egg/syris/materials.py", line 324, in make_stepanov
res = urllib.request.urlopen(url)
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
If you put the web address into a browser, does it work? It does for me.
On Fri, May 5, 2023, 7:30 AM Tomas Farago @.***> wrote:
For me it works with neither original neither yours. Try this script:
import loggingimport numpy as npimport quantities as qimport syrisfrom syris.materials import make_stepanov syris.init(loglevel=logging.DEBUG)energies = np.arange(10, 50) q.keVfuel_material = make_stepanov('C12H26', energies, density=0.745 q.g / q.cm **3)
For me it gives:
Some output which is not relevant and then this
2023-05-05 14:27:06,714 - syris.materials - DEBUG - https://x-server.gmca.aps.anl.gov/cgi/x0h_form.exe?xway=2&wave=10.0&coway=2&chem=C12H26&rho=0.745&i1=1&i2=1&i3=1&df1df2=-1&modeout=1 Traceback (most recent call last): File "material_creation.py", line 9, in
fuel_material = make_stepanov('C12H26', energies, density=0.745 * q.g / q.cm *3) File "/home/tomas/virtenvs/syris/lib/python3.8/site-packages/syris-0.4.dev0-py3.8.egg/syris/materials.py", line 324, in make_stepanov res = urllib.request.urlopen(url) File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.8/urllib/request.py", line 531, in open response = meth(req, response) File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response response = self.parent.error( File "/usr/lib/python3.8/urllib/request.py", line 569, in error return self._call_chain(args) File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain result = func(*args) File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 403: Forbidden — Reply to this email directly, view it on GitHub https://github.com/ufo-kit/syris/pull/15#issuecomment-1536190990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOHRUP3VVJFPPLVCFCRGW3XETXE3ANCNFSM6AAAAAAXUTDLOY . You are receiving this because you authored the thread.Message ID: @.***>
Yeah in a browser yes, but not via python. Does it for you?
Maybe @MarcusZuber has an idea?
I will have a close look on Monday.
Did you check the address in browser/python from the same computer? I only remembered, that the IP of Patricks PC once (ages ago) got blacklisted after to many requests at the stepanov server.
Tomas, Your code snippet runs fine for me with the version of the code in the pull request. Of course, as I am at APS, as is Stepanov, I am not sure that is a rigorous test, since perhaps I would have more permissions from inside APS than from outside.
Alan
On Fri, May 5, 2023 at 8:43 AM Marcus Zuber @.***> wrote:
I will have a close look on Monday.
Did you check the address in browser/python from the same computer? I only remembered, that the IP of Patricks PC once (ages ago) got blacklisted after to many requests at the stepanov server.
— Reply to this email directly, view it on GitHub https://github.com/ufo-kit/syris/pull/15#issuecomment-1536283330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOHRUPYOGF3BGDZR4JCQYLXET7YHANCNFSM6AAAAAAXUTDLOY . You are receiving this because you authored the thread.Message ID: @.***>
Alright, but then this is not a Python problem anymore, the changes look good, so let's merge.
On a clean installation, I had problems both with getting the simple.py example to run and with getting the make_stepanov() method in materials.py to run; I need to simulate at > 30 keV, so make_henke() would not work for me. I modified both files so they now work.