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

variable naming / destructuring #2465

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

penelopeysm
Copy link
Member

I thought I'd put some code suggestions in a PR rather than review comments, because to suggest all these changes would have been fiddly and error-prone.

Basically, I'm proposing these changes:

  • the _local variable names are a bit repetitive and have lost their meaning since the loop was extracted into a function, so I got rid of most of them.
  • I prefer to call the top thing varname_tuples, as that better reflects the fact that there are two nested levels of containers (as opposed to varnames which suggests only one level)
  • using h, t... = container as opposed to explicit indexing [2:end], as I think it's cleaner and better reflects what we're trying to do (pluck off the first element and keep the rest for later)

@penelopeysm penelopeysm requested a review from mhauru January 14, 2025 12:37
@penelopeysm
Copy link
Member Author

Of course, feel free to push back on any of it like normal review comments:)

@penelopeysm penelopeysm force-pushed the py/recursive-gibbs-naming branch from aacb4ed to e18bbac Compare January 14, 2025 12:39
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.01%. Comparing base (c44d81a) to head (2345126).
Report is 2 commits behind head on mhauru/recursive-gibbs.

Additional details and impacted files
@@                   Coverage Diff                   @@
##           mhauru/recursive-gibbs    #2465   +/-   ##
=======================================================
  Coverage                   85.01%   85.01%           
=======================================================
  Files                          21       21           
  Lines                        1582     1582           
=======================================================
  Hits                         1345     1345           
  Misses                        237      237           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mhauru mhauru left a comment

Choose a reason for hiding this comment

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

Happy with the other changes, but see comment above for varname_tuples.

src/mcmc/gibbs.jl Outdated Show resolved Hide resolved
Copy link
Member

@mhauru mhauru left a comment

Choose a reason for hiding this comment

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

Good changes, thanks!

@penelopeysm penelopeysm merged commit d93a0dd into mhauru/recursive-gibbs Jan 14, 2025
54 of 58 checks passed
@penelopeysm penelopeysm deleted the py/recursive-gibbs-naming branch January 14, 2025 15:56
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