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

Changes for upper and lower errors when determining fundamental parameters. #91

Merged
merged 31 commits into from
Nov 11, 2024

Conversation

SherelynA
Copy link
Collaborator

Addresses issue #88 by calculating upper and lower error for evolutionary model derived parameters using the already integrated Monte-Carlo approach along with using a 68% central confidence interval. The method used is described in Suárez & Metchev (2022).

I was unable to run tests for the changes nonetheless, in the future tests should be written for these additions.

@kelle
Copy link
Member

kelle commented Sep 12, 2024

Now that tests are re-running, let's put this on hold until we can more of the old tests to pass.

@kelle kelle marked this pull request as draft September 12, 2024 05:19
@kelle kelle added this to the v2.1 milestone Oct 30, 2024
@kelle
Copy link
Member

kelle commented Oct 30, 2024

It looks like the tests need to be modified as a result of these changes.

@kelle
Copy link
Member

kelle commented Oct 30, 2024

It would be ideal to get this merged and part of the next release.

@SherelynA
Copy link
Collaborator Author

@kelle the tests seem to work !

@SherelynA SherelynA self-assigned this Oct 31, 2024
Copy link
Member

@kelle kelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Minor comments to delete some comment blocks.

Only thing it needs is a couple new tests. We can discuss at our meeting later today.

sedkit/sed.py Outdated Show resolved Hide resolved
sedkit/sed.py Outdated Show resolved Hide resolved
sedkit/utilities.py Outdated Show resolved Hide resolved
@kelle kelle requested a review from hover2pi October 31, 2024 14:34
@kelle
Copy link
Member

kelle commented Oct 31, 2024

@hover2pi , this is very close to being merged. Please take a look! And let us know if you have any ideas for tests for this new functionality.

Copy link
Member

@hover2pi hover2pi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for all the awesome improvements @SherelynA !

@SherelynA
Copy link
Collaborator Author

@hover2pi and @kelle, I have this index.p file that shows up in my changes though I don't recall changing it, do you guys have an idea about what it may be and if I should be committing it too?

@kelle
Copy link
Member

kelle commented Oct 31, 2024

I had the same question! It's a cache file and doesn't need to be added to the repo.

I think we should add to the gitignore. I'll open a new issue. #117

@hover2pi
Copy link
Member

Pretty sure that's an index for the model atmosphere files to greatly speed up the model fitting. The code looks for it when fitting models and generates it automatically if it's absent so you could add it to the .gitignore. When a user wants to fit any model grids, they'll just have to wait ~2 minutes the first time they try but it prints a warning if I remember correctly.

@SherelynA
Copy link
Collaborator Author

@kelle and @hover2pi right now I am writing some additional tests for different scenarios of uncertainties for the xval and yparams, and when we provide no xval or yparam uncertainty, the mass is way off that what we calculated, so like for example the other cases gives something like 0.072 Sol masses and the last scenario gives 0.020 something,

so I am a bit confused on how to write a test that checks for all the values without the last one failing. I had assert (np.isclose(result[0].value, 0.074, atol=0.005)) but you can see how this would fail since we are using python mark paramterize and now it goest through a loop and the last one is not close at all.

@kelle
Copy link
Member

kelle commented Nov 1, 2024

please commit and push the code which is failing.. Nevermind, see below suggestion for to include different expected results with pytest.mark.parametrize

@SherelynA
Copy link
Collaborator Author

@kelle and @hover2pi, logg doesn't have units since it is a log but couldn't we technically provide it the astropy unit of u.dex?

@SherelynA
Copy link
Collaborator Author

@hover2pi I see in an old test you wrote, in test_isochrone.py, you tested a scenario where the lbol and age don't have uncertainties, but I guess I wanted to know in what scenario you think we could get something like this?

@SherelynA SherelynA requested a review from kelle November 5, 2024 01:29
@hover2pi
Copy link
Member

hover2pi commented Nov 5, 2024

@SherelynA I suspect that test was just to check the no-uncertainty handling for arbitrary variables, not a specific use case. Feel free to change it to something more probative!

@hover2pi
Copy link
Member

hover2pi commented Nov 5, 2024

I also remember trying to use dex units and it was problematic for some reason that I can't recall. You could try to put that in but it might me a minefield and I'm not sure we gain much since the functions already check for units and handle them accordingly. Admittedly the hasattr('unit') check isn't ideal but I would recommend only supporting dex units if it actually fixes something that is broken.

@SherelynA
Copy link
Collaborator Author

I also remember trying to use dex units and it was problematic for some reason that I can't recall. You could try to put that in but it might me a minefield and I'm not sure we gain much since the functions already check for units and handle them accordingly. Admittedly the hasattr('unit') check isn't ideal but I would recommend only supporting dex units if it actually fixes something that is broken.

@hover2pi Yeah, I agree that I don't think we gain much by trying to add it. The only reason I asked was because during checking tests I realized that all the results had units except logg so I had to change accordingly. However, since you mentioned it being problematic I think it is best to just have the the condition in the tests and not try to add units.

@SherelynA SherelynA marked this pull request as ready for review November 7, 2024 03:50
@SherelynA SherelynA requested a review from hover2pi November 7, 2024 03:50
Copy link
Member

@hover2pi hover2pi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic. Thanks @SherelynA !

Copy link
Member

@kelle kelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!!

@kelle kelle merged commit ec10110 into BDNYC:main Nov 11, 2024
1 check passed
@SherelynA SherelynA deleted the asym_unc branch November 12, 2024 03:49
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

Successfully merging this pull request may close these issues.

3 participants