<commit_before>"""The tests here ensure that the Python and Java/Jython scripting are
consistent with each other. The initial tests here come from
pre-existing Jython scripting code.

"""

import os
import unittest

import opensim as osim

test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
                        'tests')

# Silence warning messages if mesh (.vtp) files cannot be found.
osim.Model.setDebugLevel(0)

def assert_almost_equal(valA, valB, tol=1e-5):
    assert abs(valA - valB) < 1e-5

class TestConsistentWithJython(unittest.TestCase):
    def test_makeUlnaHeavy(self):
    
        # Get handle to the Arm26 model
        oldModel = osim.Model(os.path.join(test_dir, "arm26.osim"))
        # Create a fresh copy
        myModel = oldModel.clone()
    
        # Initialize the copy, if values need to be set in the model's state
        # pass along the variable myState  returned by initSystem
        myState = myModel.initSystem()
    
        # Name the copy for later display in the GUI<commit_msg>Fixed assert_almost_equal where tol was not used<commit_after>"""The tests here ensure that the Python and Java/Jython scripting are
consistent with each other. The initial tests here come from
pre-existing Jython scripting code.

"""

import os
import unittest

import opensim as osim

test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)),
                        'tests')

# Silence warning messages if mesh (.vtp) files cannot be found.
osim.Model.setDebugLevel(0)

def assert_almost_equal(valA, valB, tol=1e-5):
    assert abs(valA - valB) < tol

class TestConsistentWithJython(unittest.TestCase):
    def test_makeUlnaHeavy(self):
    
        # Get handle to the Arm26 model
        oldModel = osim.Model(os.path.join(test_dir, "arm26.osim"))
        # Create a fresh copy
        myModel = oldModel.clone()
    
        # Initialize the copy, if values need to be set in the model's state
        # pass along the variable myState  returned by initSystem
        myState = myModel.initSystem()
    
        # Name the copy for later display in the GUI
{'fraction_non_alphanumeric': 0.07971698113207547, 'fraction_numerical': 0.007547169811320755, 'mean_word_length': 3.0018867924528303, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7386290', 'n_tokens_mistral': 664, 'n_tokens_neox': 641, 'n_words': 219}