public function setConfigurableAttributeWeights($attribute_set = 'default', array $weights = []) {
    $attribute_set = strtolower($attribute_set);

    // Update weights for particular attribute set in config.
    $existing_weights = $this->config->get('attribute_weights');
    $existing_weights[$attribute_set] = $weights;

    $config = $this->configFactory->getEditable(self::CONFIG_KEY);
    $config->set('attribute_weights', $existing_weights);
    $config->save();

    // Reload config.
    $this->config = $this->configFactory->get(self::CONFIG_KEY);
  }