-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fornax_2019
model cannot be used with snewpy.snowglobes
#165
Comments
@JostMigenda, how about we just pass default parameters ( |
That would fix this error only superficially; the bigger issue of not being able to set it would remain. I guess it depends: Is there a good default direction that will cover most use cases of this model? Or is a major reason to make the extra effort to include full directional dependence of the signal that we want to let users compare multiple direction? If it's the latter, then we should try to expose that in |
In principle the direction is interesting: see the Fornax 2019 notebook for how much the anisotropy changes as the explosion evolves. And I expect there will be future models that allow for anisotropic emission, so it's worth finding some solution. Passing kwargs may be the right approach, since the alternative would seem to be requiring these parameters get introduced in the base class... which is ROOT's approach to object-oriented programming. I don't think that's acceptable. If this is actually causing a test failure, we could temporarily use the default settings, close this as a bug fix, and make a lower-priority enhancement ticket to enable anisotropic emission models. It's up to you and your opinion of how serious the issue is at the moment. |
It’s not causing a test failure, since we’re not testing that model with SNOwGLoBES currently; so no need for a temporary fix. Additional note: See the changes to |
At the SNEWPY developer/user meeting today, we discussed that it may be better to move these arguments into the initialiser. That way the existing kwarg mechanism would work without any changes to the rest of the SNEWPY code; and the model registry code which constructs a file name from the physics parameters can simply ignore |
I missed this discussion before.
Do I understand correctly that if a user wants to plot this model's predictions for N |
In principle yes. |
You propose a model to maintain some state (keeping the angles) only to use it when the |
I agree that that part is not elegant. However, it does make enough other parts of snewpy better, that I think it’s worth the trade-off:
|
The
Fornax_2019
model’sget_initial_spectra()
method has two required arguments not used by other models:theta
andphi
of the observer direction. Sincegenerate_time_series()
/generate_fluence()
doesn’t include those arguments when it callsget_transformed_spectra()
, which calls the respective model class’sget_initial_spectra()
, code like(adapted from
SNOwGLoBES_usage.ipynb
) will result inTypeError: get_initial_spectra() missing 2 required positional arguments: 'theta' and 'phi'
.Similar to what @soso128 suggests in #164, this could be fixed by passing arbitrary
**kwargs
along that call chain; though we should be careful to avoid edge cases like if a model class’s__init__()
andget_initial_spectra()
have additional arguments with the same name.The text was updated successfully, but these errors were encountered: