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

Append ! suffix to functions which mutate their arguments #319

Closed
wants to merge 4 commits into from
Closed

Append ! suffix to functions which mutate their arguments #319

wants to merge 4 commits into from

Conversation

EngPeterAtef
Copy link

PR for issue #232

This commit updates the SurveyDesign constructor to SurveyDesign! across
multiple files including SurveyDesign.jl, by.jl, and runtests.jl. The change
reflects a move towards a more explicit indication of in-place modifications
or significant changes that the constructor might perform on the data it
receives. This naming convention aligns with Julia's standard practice of
using the bang symbol (!) to denote functions that modify their arguments
or have important side effects.

Additionally, minor formatting adjustments were made in runtests.jl to
improve code readability and consistency with Julia's style guidelines.
by mistake I changed the names of classes not fucntions
This commit updates the usage of `SurveyDesign` to `SurveyDesign!` in various instances within the test suite. The change reflects the need for mutable operations on the survey design objects, aligning with the Julia convention of using the bang symbol (!) to indicate functions that modify their arguments in place. This adjustment ensures that the test suite correctly utilizes the API for creating and modifying survey designs, particularly in the context of applying bootstrap and jackknife weights, as well as handling different sampling strategies such as simple random sampling, stratified sampling, and cluster sampling. The update is critical for maintaining the integrity and accuracy of the survey analysis tests.
This commit includes a series of changes aimed at refactoring the constructors for SurveyDesign and ReplicateDesign within the SurveyDesign.jl file, as well as improving code formatting across multiple files. The primary changes involve the removal of unnecessary spaces around equals signs in default parameter assignments and ensuring consistency in the use of spaces for better readability. Additionally, the `SurveyDesign!` constructor has been renamed to `SurveyDesign` to follow Julia's naming conventions more closely, indicating that the function does not modify its arguments in place.

In the test suite (runtests.jl), corresponding adjustments have been made to use the updated constructor names. This change ensures that the tests remain aligned with the source code modifications.

Furthermore, minor adjustments in other files, such as by.jl and load_data.jl, include formatting improvements and the adoption of a consistent style for default parameter values. These changes contribute to the overall code quality and maintainability of the project.

This refactor does not introduce any new functionality but significantly enhances the code's readability and consistency, making it easier for future contributors to understand and work with the codebase.
@EngPeterAtef EngPeterAtef closed this by deleting the head repository Mar 20, 2024
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.

1 participant