<commit_before>import numpy as np
import re

class WheelGeometry:
    'Geometric parameters including size and lacing pattern'

    def sort_spokes(self):
        # Sort spokes by rim node
        self.lace_hub_n = self.lace_hub_n[self.lace_rim_n.argsort()]
        self.lace_rim_n.sort()

    def parse_wheel_file(self, fname):

        def keyword_rim(l, f):

            # Default values
            args = {'diam': 0.6, 'spacing': 'default', 'N': 36}

            # Parse arguments
            l_args = l.strip().split()
            for c in l_args[1::]:
                # Set option
                key = c.split('=')[0]
                arg = c.split('=')[1]
                if key in args:
                    args[key] = arg<commit_msg>add __str__() method for nice printing<commit_after>import numpy as np
import re

class WheelGeometry:
    'Geometric parameters including size and lacing pattern'

    def __str__(self):
        return ("Bicycle wheel geometry object\n"
                "  rim diameter        :{rd:6.1f} mm\n"
                "  hub diameter        :{hd1:6.1f} mm\n"
                "  hub diameter (drive):{hd2:6.1f} mm\n"
                "  hub width           :{hw1:6.1f} mm\n"
                "  hub width (drive)   :{hw2:6.1f} mm\n"
                "  number of spokes    :{ns:6d}\n").format(rd=self.d_rim*1000,
                                                         hd1=self.d1_hub*1000,
                                                         hd2=self.d2_hub*1000,
                                                         hw1=self.w1_hub*1000,
                                                         hw2=self.w2_hub*1000,
                                                         ns=len(self.lace_hub_n))

    def sort_spokes(self):
        # Sort spokes by rim node
        self.lace_hub_n = self.lace_hub_n[self.lace_rim_n.argsort()]
        self.lace_rim_n.sort()

    def parse_wheel_file(self, fname):

        def keyword_rim(l, f):

            # Default values
            args = {'diam': 0.6, 'spacing': 'default', 'N': 36}

            # Parse arguments
            l_args = l.strip().split()
            for c in l_args[1::]:
                # Set option
                key = c.split('=')[0]
                arg = c.split('=')[1]
                if key in args:
                    args[key] = arg
{'fraction_non_alphanumeric': 0.10997442455242967, 'fraction_numerical': 0.024296675191815855, 'mean_word_length': 1.245933014354067, '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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '887910', 'n_tokens_mistral': 728, 'n_tokens_neox': 672, 'n_words': 161}