<commit_before>﻿using System;
using System.Collections.Generic;

namespace principia {
namespace ksp_plugin_adapter {

internal static class ConfigNodeParsers {
  public static BodyParameters NewCartesianBodyParameters(CelestialBody body,
                                                          ConfigNode node) {
    return new BodyParameters{
        name                    = body.name,
        gravitational_parameter =
            node.GetUniqueValue("gravitational_parameter"),
        reference_instant       = node.GetAtMostOneValue("reference_instant"),
        min_radius              =
            (body.pqsController?.radiusMin ?? body.Radius) + " m",
        mean_radius             = body.Radius + " m",
        max_radius              =
            (body.pqsController?.radiusMax ?? body.Radius) + " m",
        axis_right_ascension    =
            node.GetAtMostOneValue("axis_right_ascension"),
        axis_declination        = node.GetAtMostOneValue("axis_declination"),
        reference_angle         = node.GetAtMostOneValue("reference_angle"),
        angular_frequency       = node.GetAtMostOneValue("angular_frequency"),
        reference_radius        = node.GetAtMostOneValue("reference_radius"),
        j2                      = node.GetAtMostOneValue("j2"),
        geopotential            = node.GetBodyGeopotentialElements().ToArray()
    };
  }

  public static ConfigurationAccuracyParameters
      NewConfigurationAccuracyParameters(ConfigNode node) {
    return new ConfigurationAccuracyParameters{
        fitting_tolerance      = node.GetUniqueValue("fitting_tolerance"),
        geopotential_tolerance = node.GetUniqueValue("geopotential_tolerance")
    };
  }

  public static ConfigurationAdaptiveStepParameters
      NewConfigurationAdaptiveStepParameters(ConfigNode node) {
    return new ConfigurationAdaptiveStepParameters{
        adaptive_step_size_integrator =
            node.GetUniqueValue("adaptive_step_size_integrator"),
        length_integration_tolerance  =
            node.GetUniqueValue("length_integration_tolerance"),
        speed_integration_tolerance   =
            node.GetUniqueValue("speed_integration_tolerance")
    };
  }

  public static ConfigurationDownsamplingParameters
      NewConfigurationDownsamplingParameters(ConfigNode node)
  {
    return new ConfigurationDownsamplingParameters{
      max_dense_intervals =
          node.GetUniqueValue("downsampling_max_dense_intervals"),
      tolerance = node.GetUniqueValue("downsampling_tolerance")
    };
  }

      public static ConfigurationFixedStepParameters
      NewConfigurationFixedStepParameters(ConfigNode node) {
    return new ConfigurationFixedStepParameters{
        fixed_step_size_integrator =
            node.GetUniqueValue("fixed_step_size_integrator"),
        integration_step_size      =
            node.GetUniqueValue("integration_step_size")
    };
  }<commit_msg>Formatting and field names.<commit_after>﻿using System;
using System.Collections.Generic;

namespace principia {
namespace ksp_plugin_adapter {

internal static class ConfigNodeParsers {
  public static BodyParameters NewCartesianBodyParameters(CelestialBody body,
                                                          ConfigNode node) {
    return new BodyParameters{
        name                    = body.name,
        gravitational_parameter =
            node.GetUniqueValue("gravitational_parameter"),
        reference_instant       = node.GetAtMostOneValue("reference_instant"),
        min_radius              =
            (body.pqsController?.radiusMin ?? body.Radius) + " m",
        mean_radius             = body.Radius + " m",
        max_radius              =
            (body.pqsController?.radiusMax ?? body.Radius) + " m",
        axis_right_ascension    =
            node.GetAtMostOneValue("axis_right_ascension"),
        axis_declination        = node.GetAtMostOneValue("axis_declination"),
        reference_angle         = node.GetAtMostOneValue("reference_angle"),
        angular_frequency       = node.GetAtMostOneValue("angular_frequency"),
        reference_radius        = node.GetAtMostOneValue("reference_radius"),
        j2                      = node.GetAtMostOneValue("j2"),
        geopotential            = node.GetBodyGeopotentialElements().ToArray()
    };
  }

  public static ConfigurationAccuracyParameters
      NewConfigurationAccuracyParameters(ConfigNode node) {
    return new ConfigurationAccuracyParameters{
        fitting_tolerance      = node.GetUniqueValue("fitting_tolerance"),
        geopotential_tolerance = node.GetUniqueValue("geopotential_tolerance")
    };
  }

  public static ConfigurationAdaptiveStepParameters
      NewConfigurationAdaptiveStepParameters(ConfigNode node) {
    return new ConfigurationAdaptiveStepParameters{
        adaptive_step_size_integrator =
            node.GetUniqueValue("adaptive_step_size_integrator"),
        length_integration_tolerance  =
            node.GetUniqueValue("length_integration_tolerance"),
        speed_integration_tolerance   =
            node.GetUniqueValue("speed_integration_tolerance")
    };
  }

  public static ConfigurationDownsamplingParameters
      NewConfigurationDownsamplingParameters(ConfigNode node) {
    return new ConfigurationDownsamplingParameters{
        max_dense_intervals = node.GetUniqueValue("max_dense_intervals"),
        tolerance = node.GetUniqueValue("tolerance")
    };
  }

  public static ConfigurationFixedStepParameters
      NewConfigurationFixedStepParameters(ConfigNode node) {
    return new ConfigurationFixedStepParameters{
        fixed_step_size_integrator =
            node.GetUniqueValue("fixed_step_size_integrator"),
        integration_step_size      =
            node.GetUniqueValue("integration_step_size")
    };
  }
{'fraction_non_alphanumeric': 0.07037164487267722, 'fraction_numerical': 0.0006882312456985547, 'mean_word_length': 2.831905075807515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '811436', 'n_tokens_mistral': 1483, 'n_tokens_neox': 1405, 'n_words': 209}