Skip to content

gridutils.tuple_chisq can now handle unfrozen parameters#1964

Open
dlakaplan wants to merge 14 commits intonanograv:masterfrom
dlakaplan:parallelfit
Open

gridutils.tuple_chisq can now handle unfrozen parameters#1964
dlakaplan wants to merge 14 commits intonanograv:masterfrom
dlakaplan:parallelfit

Conversation

@dlakaplan
Copy link
Contributor

@dlakaplan dlakaplan commented Feb 13, 2026

Previously the parameters for gridutils.tuple_chisq and gridutils.tuple_chisq_extra were fixed and frozen at the user-supplied values. Now select parameters can also be unfrozen. The dof is now returned as well (since that can change).

@dlakaplan dlakaplan added enhancement awaiting review This PR needs someone to review it so it can be merged minor A minor PR that doesn't need a lot of thought labels Mar 2, 2026
Copy link
Member

@scottransom scottransom left a comment

Choose a reason for hiding this comment

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

Just the one question.


# All other unfrozen parameters will be fitted for at each grid point
chi2 = np.zeros(len(parvalues))
dof = np.zeros(len(parvalues), dtype=np.int16)
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason why you want this to be int16? Isn't it possible to overflow that if you have a ton of TOAs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. this was mostly just so that it would be an int instead of a float. Could make it int32 if you think it's worth it.

Copy link
Member

Choose a reason for hiding this comment

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

I definitely think it needs to be at least np.int32 (due to possible overflow as mentioned). But truthfully, I don't see any reason to use anything less than native ints in general here (we aren't trying to save memory or anything), so np.int64 (which should be the default int on most machines) should be totally fine!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This has been changed. Let me know if you have any further comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review This PR needs someone to review it so it can be merged enhancement minor A minor PR that doesn't need a lot of thought

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants