Skip to content
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

'Surface' class is undefined in src, ReflectiveLayer class is 'abstract', 'SourceParticleType' class doesn't exist #17

Open
AlexKyriacou92 opened this issue Aug 1, 2022 · 0 comments

Comments

@AlexKyriacou92
Copy link

AlexKyriacou92 commented Aug 1, 2022

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.

  1. 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.

  1. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant