Example #1
0
def main():
    """Creates reference databases. Assumes that cyclus is included into PATH.
    """
    cwd = os.getcwd()

    # Run cyclus
    run_cyclus("cyclus", cwd, sim_files)
def main():
    """Creates reference databases. Assumes that cyclus is included into PATH.
    """
    cwd = os.getcwd()

    # Run cyclus
    run_cyclus("cyclus", cwd, sim_files)
Example #3
0
    def test_regression(self, check_deterministic=False):
        """Test for all inputs in sim_files. Checks if reference and current cyclus 
        output is the same.

        Parameters
        ----------
        check_deterministic : bool
            If True, also test determinisitc equality of simulations
        
        WARNING: the tests require cyclus executable to be included in PATH
        """
        for root, dirs, files in os.walk(self.in_dir_):
            for f in files:
                if not f.endswith('.xml'):
                    continue
                tmp_file = self.tmp_files_[f]
                run_cyclus("cyclus", os.getcwd(), os.path.join(root, f),
                           tmp_file)

                if os.path.isfile(tmp_file):
                    if f not in sim_files:
                        continue  # nada to do, just making sure it runs
                    if check_deterministic:
                        determ = compare_determ(sim_files[f],
                                                tmp_file,
                                                verbose=True)
                        assert_true(determ)
                    else:
                        nondeterm = compare_nondeterm(sim_files[f], tmp_file)
                        assert_true(nondeterm)

                if os.path.isfile(tmp_file):
                    print("removing {0}".format(tmp_file))
                    os.remove(tmp_file)

                tmp_file = tmp_file.split('.')[0] + '.sqlite'

                if os.path.isfile(tmp_file):
                    print("removing {0}".format(tmp_file))
                    os.remove(tmp_file)
Example #4
0
    def test_regression(self, check_deterministic=False):
        """Test for all inputs in sim_files. Checks if reference and current cyclus 
        output is the same.

        Parameters
        ----------
        check_deterministic : bool
            If True, also test determinisitc equality of simulations
        
        WARNING: the tests require cyclus executable to be included in PATH
        """
        for root, dirs, files in os.walk(self.in_dir_):
            for f in files:
                if not f.endswith('.xml'):
                    continue
                tmp_file = self.tmp_files_[f]
                run_cyclus("cyclus", os.getcwd(), os.path.join(root, f), 
                           tmp_file)

                if os.path.isfile(tmp_file):
                    if f not in sim_files:
                        continue # nada to do, just making sure it runs
                    if check_deterministic:
                        determ = compare_determ(sim_files[f], tmp_file, 
                                                verbose=True)
                        assert_true(determ)
                    else:         
                        nondeterm = compare_nondeterm(sim_files[f], tmp_file)
                        assert_true(nondeterm)

                if os.path.isfile(tmp_file):
                    print("removing {0}".format(tmp_file))
                    os.remove(tmp_file)
                
                tmp_file = tmp_file.split('.')[0] + '.sqlite'
                
                if os.path.isfile(tmp_file):
                    print("removing {0}".format(tmp_file))
                    os.remove(tmp_file)