Skip to content

Glitch tweak #1867

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

Merged
merged 5 commits into from
Dec 9, 2024
Merged

Glitch tweak #1867

merged 5 commits into from
Dec 9, 2024

Conversation

kerrm
Copy link
Contributor

@kerrm kerrm commented Dec 4, 2024

I noticed a bunch of nearly-duplicate code in the Glitch derivatives, so I pushed that into the "deriv_prep" function. Otherwise, I switched to f-strings, cleaned up the math and syntax in a few places, and added some missing tests for sanity checks on models.

(E.g., the code attempts to test for a missing GLEP, but there was no test coverage for that. The code only checked for whether or not a GLEP was present, but it always is! It's value is set to None, though, so the code now checks for that and the test covers it.

@abhisrkckl
Copy link
Contributor

Please add a CHANGELOG entry.

Comment on lines 148 to 154
if not hasattr(self, param + "%d" % idx):
if not hasattr(self, param + str(idx)):
param0 = getattr(self, f"{param}1")
self.add_param(param0.new_param(idx))
getattr(self, param + "%d" % idx).value = 0.0
getattr(self, param + str(idx)).value = 0.0
self.register_deriv_funcs(
getattr(self, f"d_phase_d_{param[:-1]}"), param + "%d" % idx
getattr(self, f"d_phase_d_{param[:-1]}"), param + str(idx)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

It will be better to use fstring instead of the + operator here since that is the style we had decided to prefer.

@kerrm
Copy link
Contributor Author

kerrm commented Dec 5, 2024

Please add a CHANGELOG entry.

I'm never sure where to draw the line but... is it worth noting relatively minor code cleanup in the CHANGELOG? It's not something, imo, that users of new versions really need to be aware of.

@abhisrkckl
Copy link
Contributor

I think it's good for posterity, in case someone wonders in the future when/how/why some change was made.

@abhisrkckl abhisrkckl merged commit ee1852d into nanograv:master Dec 9, 2024
7 checks passed
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.

2 participants