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

Refactor and Optimization:: Argument Table Formation:: Constants.py #268

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

Conversation

IIITM-Jay
Copy link

@IIITM-Jay IIITM-Jay commented Jul 22, 2024

About

This PR deals with refactoring and optimization towards Argument Lookup Table (arg_lut) of constants.py. It focuses on optimizing the code with fewer lines keeping the objective same to provide better readability and concise comprehension.

Added/ Modified Changes

  1. Changed the formation of arg_lut = {}: Used dictionary comprehension to form the required arg_lut
  2. Read the CSV file and processes each row to convert the necessary values and build the dictionary.
  3. Added appropriate comments
  4. Avoided explicit iteration and assignment of values within a loop
  5. Removed redundancy: prior declaration of a dictionary

Approach/ Technique/ Principles Used

  1. Dictionary Comprehension:
    a. Offers syntax with lesser lines of codes: Dict Comprehensions , Reference taken
    {expression(variable): expression(variable) for variable, variable in input_set [predicate][, …]}
    b. Does exactly the same job without having prior declaration of the dictionary variable

@IIITM-Jay IIITM-Jay changed the title Refactor and Optimiation:: Argument Table Formation:: Constants.py Refactor and Optimization:: Argument Table Formation:: Constants.py Jul 22, 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