<commit_before>#================================================================================
#
# Imports
#
#================================================================================
import unittest
import euler_physics
import numpy as np
import numpy.testing as npt

#================================================================================
#
# Class definitions
#
#================================================================================
class EulerPhysicsTestCase(unittest.TestCase):
        """Tests for `euler_physics.py`."""

        #================================================================================
        # max_wave_speed
        def test_max_wave_speed(self):
                """Is the max wave speed solver correct?"""

                # toy data
                u = np.arange(1,12*3+1).reshape((3,12))

                # Get the maximum wave speed
                m = euler_physics.max_wave_speed(u)

                # test
                npt.assert_array_almost_equal(m,2.74833147735, decimal = 7)


        #================================================================================
        # riemann_rusanov
        def test_riemann_rusanov(self):
                """Is the Rusanov Riemann solver correct?"""

                # Left/right toy data
                ul = np.arange(1,13)
                ur = np.arange(1,13)[::-1]
            
                # Get the flux
                F = euler_physics.riemann_rusanov(ul,ur)<commit_msg>Fixed euler physics test so it can run independently.<commit_after>#================================================================================
#
# Imports
#
#================================================================================
import unittest
import constants
import euler_physics
import numpy as np
import numpy.testing as npt

#================================================================================
#
# Class definitions
#
#================================================================================
class EulerPhysicsTestCase(unittest.TestCase):
        """Tests for `euler_physics.py`."""

        #================================================================================
        # Set up
        def setUp(self):
                constants.init()

        #================================================================================
        # max_wave_speed
        def test_max_wave_speed(self):
                """Is the max wave speed solver correct?"""

                # toy data
                u = np.arange(1,12*3+1).reshape((3,12))

                # Get the maximum wave speed
                m = euler_physics.max_wave_speed(u)

                # test
                npt.assert_array_almost_equal(m,2.74833147735, decimal = 7)


        #================================================================================
        # riemann_rusanov
        def test_riemann_rusanov(self):
                """Is the Rusanov Riemann solver correct?"""

                # Left/right toy data
                ul = np.arange(1,13)
                ur = np.arange(1,13)[::-1]
            
                # Get the flux
                F = euler_physics.riemann_rusanov(ul,ur)
{'fraction_non_alphanumeric': 0.38780563293098114, 'fraction_numerical': 0.017332095326524296, 'mean_word_length': 2.8522050059594757, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2953839', 'n_tokens_mistral': 804, 'n_tokens_neox': 676, 'n_words': 148}