Skip to content

Refactor argument handling: simplify logic by using arg_len variable #915

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kaz2700
Copy link

@kaz2700 kaz2700 commented Apr 8, 2025

Provide an overview of the implemented solution or the fix and elaborate on the modifications.

Refactored the argument handling logic in the simulation code. Introduced a variable arg_len to simplify the checks on the length of args and reduce redundancy. The new structure first checks the length of args and branches accordingly to call the appropriate simulation methods (_simulate_power_law, _simulate_model, _simulate_model_string, _simulate_power_spectrum, or _simulate_impulse_response) based on the type and number of arguments passed.

Is there a new dependency introduced by your contribution? If so, please specify.

No new dependencies have been introduced.

Any other comments?

This refactor improves the readability and maintainability of the code.

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