You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone,
I installed the RadioPropa software onto my laptop (runs Ubuntu 18.04) and I was successfully able to run some of the examples in radio_example, however I get a number of errors:
1.When I run n2linear.py :
File "n2linear.py", line 17, in
source.add(radiopropa.SourceParticleType(radiopropa.nucleusId(1, 1)))
AttributeError: module 'radiopropa' has no attribute 'SourceParticleType'
It seems that radiopropa.py does not have a class or anything else corresponding to 'SourceParticleType' and the same is true for the C++ source code. When I comment out this line, then the code works. Additionally, I'm not sure what's the purpose 'SourceParticleType' in a ray tracing code, is it possible that this is a legacy feature from CRPropa that's not necessary for RadioPropa.
When I run ReflectionRefraction.py
File "ReflectionRefraction.py", line 8, in
reflective = radiopropa.ReflectiveLayer(radiopropa.Plane(radiopropa.Vector3d(0,0,-50.), radiopropa.Vector3d(0,0,1)),.5)
File "/home/enex/RadioPropaAlex/radiopropa/build/radiopropa.py", line 5714, in init
raise AttributeError("No constructor defined - class is abstract")
AttributeError: No constructor defined - class is abstract
The error comes from the ReflectiveLayer class in python, in the init function is simply raises an AttributeError that the class from which it was constructed is abstract. ReflectiveLayer is defined as a class in Discontinuity.cpp but SWIG is unable to properly construct it as a class in Python because its 'abstract'.
I tried an experiment where I replaced ReflectiveLayer with TransmissiveLayer and then the code worked. TransmissiveLayer is also defined in the same source file as ReflectiveLayer, and the definition of the classes looks identical, so I'm not sure why one is abstract and one isn't.
Both of these classes ReflectiveLayer and TransmssiveLayer, along with other classes in the source code, use the 'Surface' class an argument. However I can't find a definition of 'Surface' in the source code. Also, in the main python script radiopropa.py in the build directory, there is a reference to 'Surface' but it has the same problem as ReflectiveLayer where the the init function raises the error: AttributeError: No constructor defined - class is abstract
I'm not sure these problems came from my side or if there are some issues with the source code. I would point out that I don't have CRPropa on my computer so maybe there's some missing definitions in the RadioPropa source code that went unnoticed because they are defined in CRPropa.
Do you have any suggestions as to what I could try to solve these issues?
Or is it possible that these issues are caused by bugs in the source code? radiopropa-py.txt
The text was updated successfully, but these errors were encountered:
Hello everyone,
I installed the RadioPropa software onto my laptop (runs Ubuntu 18.04) and I was successfully able to run some of the examples in radio_example, however I get a number of errors:
1.When I run n2linear.py :
File "n2linear.py", line 17, in
source.add(radiopropa.SourceParticleType(radiopropa.nucleusId(1, 1)))
AttributeError: module 'radiopropa' has no attribute 'SourceParticleType'
It seems that radiopropa.py does not have a class or anything else corresponding to 'SourceParticleType' and the same is true for the C++ source code. When I comment out this line, then the code works. Additionally, I'm not sure what's the purpose 'SourceParticleType' in a ray tracing code, is it possible that this is a legacy feature from CRPropa that's not necessary for RadioPropa.
File "ReflectionRefraction.py", line 8, in
reflective = radiopropa.ReflectiveLayer(radiopropa.Plane(radiopropa.Vector3d(0,0,-50.), radiopropa.Vector3d(0,0,1)),.5)
File "/home/enex/RadioPropaAlex/radiopropa/build/radiopropa.py", line 5714, in init
raise AttributeError("No constructor defined - class is abstract")
AttributeError: No constructor defined - class is abstract
The error comes from the ReflectiveLayer class in python, in the init function is simply raises an AttributeError that the class from which it was constructed is abstract. ReflectiveLayer is defined as a class in Discontinuity.cpp but SWIG is unable to properly construct it as a class in Python because its 'abstract'.
I tried an experiment where I replaced ReflectiveLayer with TransmissiveLayer and then the code worked. TransmissiveLayer is also defined in the same source file as ReflectiveLayer, and the definition of the classes looks identical, so I'm not sure why one is abstract and one isn't.
I'm not sure these problems came from my side or if there are some issues with the source code. I would point out that I don't have CRPropa on my computer so maybe there's some missing definitions in the RadioPropa source code that went unnoticed because they are defined in CRPropa.
Do you have any suggestions as to what I could try to solve these issues?
Or is it possible that these issues are caused by bugs in the source code?
radiopropa-py.txt
The text was updated successfully, but these errors were encountered: