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

MagnificationCurve and lack of methods information #36

Closed
rpoleski opened this issue Mar 23, 2022 · 3 comments
Closed

MagnificationCurve and lack of methods information #36

rpoleski opened this issue Mar 23, 2022 · 3 comments

Comments

@rpoleski
Copy link
Owner

>>> import MulensModel as mm
>>> params = mm.ModelParameters({'t_0': 0, 'u_0': 1., 't_E': 9., 's': 1.5, 'q': 0.5, 'alpha': 90.})
>>> mag_curve = mm.MagnificationCurve([0, 1., 10.], params)
>>> mag_curve.get_magnification()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../source/MulensModel/magnificationcurve.py", line 164, in get_magnification
    magnification = self.get_binary_lens_magnification()
  File ".../source/MulensModel/magnificationcurve.py", line 384, in get_binary_lens_magnification
    method = methods[index].lower()
AttributeError: 'NoneType' object has no attribute 'lower'

The message should give some useful information.

@rpoleski rpoleski added the quick_fix something to be fixed easily and quickly label Mar 23, 2022
@jenniferyee jenniferyee added help wanted and removed quick_fix something to be fixed easily and quickly labels Feb 16, 2023
@jenniferyee
Copy link
Collaborator

jenniferyee commented Feb 16, 2023

I don't think this is a quick fix because this error occurs for binary lenses but not point lenses. Therefore, the implementation of methods is not universal, so needs to be rethought. This is related to the overall architecture problem with how we've implemented models and magnification methods. Branch refactor_models contains ideas about the overall issues, but these problems might also be addressed by changes proposed in Issue #75.

@rpoleski
Copy link
Owner Author

rpoleski commented Feb 16, 2023

I agree that improving whole Model and MagnificationCurve architectures should solve this one, but I think we can add a test (if methods[index] is None:) and an error message without huge changes in most of the code.
Now the error is in line 423 of magnificationcurve.py.

@rpoleski
Copy link
Owner Author

rpoleski commented Oct 5, 2023

Solved in 90c18c5

@rpoleski rpoleski closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants