zbytek-team / speech-analysis

MIT License
0 stars 0 forks source link

a little bit of refactoring #28

Closed ack2406 closed 3 weeks ago

ack2406 commented 1 month ago
  1. removed unused imports 📦

  2. changed const RELATIVE_FEATURES_DIR to FEATURES_DIR 📁

  3. changed const REMOVE_KIDS to SKIP_TEENS so its more politically correct 🧒

  4. removed unnecesary comments when its turbo obvious what is the thing for like 💬

    RELATIVE_FEATURES_DIR = '../data/features'   # Relative path to the features directory
    REMOVE_KIDS = False                          # Remove kids from the dataset

or

# Loop through each language
for language in LANGUAGES:
  1. changed FEATURES_DIR to Path object, so we can skip many casts to Path later. 🌵

  2. made functions to avoid code repetition: 🔁

    • load_csv()
    • split_by_gender()
    • filter_out_teens()
    • calculate_histogram_and_bins_for_gender()
  3. now colors for male and female are taken from constant COLORS 🌈

  4. Overall comments reduction and refactor up to 3.2.2. Other blocks of code will be refactored in near future 😄

  5. Changed settings for pandas to display more information in single line: 🌮

    pd.set_option('display.max_columns', None)
    pd.set_option('display.width', 1000)
  6. Also added some TODOs for later 🌃