def runner(
            self, config, atomic_data_fname,
            tardis_ref_data, generate_reference):
        config.atom_data = atomic_data_fname

        self.name = (self._name +
                     "_{:s}".format(config.plasma.line_interaction_type))
        if config.spectrum.integrated.interpolate_shells > 0:
            self.name += '_interp'

        simulation = Simulation.from_config(config)
        simulation.run()

        if not generate_reference:
            return simulation.runner
        else:
            simulation.runner.hdf_properties = [
                    'j_blue_estimator',
                    'spectrum',
                    'spectrum_integrated'
                    ]
            simulation.runner.to_hdf(
                    tardis_ref_data,
                    '',
                    self.name)
            pytest.skip(
                    'Reference data was generated during this run.')
Ejemplo n.º 2
0
    def runner(
            self, config, atomic_data_fname,
            tardis_ref_data, generate_reference):
        config.atom_data = atomic_data_fname

        self.name = (self._name +
                     "_{:s}".format(config.plasma.line_interaction_type))
        if config.spectrum.integrated.interpolate_shells > 0:
            self.name += '_interp'

        simulation = Simulation.from_config(config)
        simulation.run()

        if not generate_reference:
            return simulation.runner
        else:
            simulation.runner.hdf_properties = [
                    'j_blue_estimator',
                    'spectrum',
                    'spectrum_integrated'
                    ]
            simulation.runner.to_hdf(
                    tardis_ref_data,
                    '',
                    self.name)
            pytest.skip(
                    'Reference data was generated during this run.')
Ejemplo n.º 3
0
    def setup(self):
        self.atom_data_filename = os.path.expanduser(os.path.expandvars(
            pytest.config.getvalue('atomic-dataset')))
        assert os.path.exists(self.atom_data_filename), ("{0} atomic datafiles"
                                                         " does not seem to "
                                                         "exist".format(
            self.atom_data_filename))
        self.config_yaml = yaml_load_config_file(
            'tardis/io/tests/data/tardis_configv1_verysimple.yml')
        self.config_yaml['atom_data'] = self.atom_data_filename

        tardis_config = Configuration.from_config_dict(self.config_yaml)
        self.simulation = Simulation.from_config(tardis_config)
        self.simulation.run()
Ejemplo n.º 4
0
    def setup(self):
        self.atom_data_filename = os.path.expanduser(
            os.path.expandvars(pytest.config.getvalue('atomic-dataset')))
        assert os.path.exists(
            self.atom_data_filename), ("{0} atomic datafiles"
                                       " does not seem to "
                                       "exist".format(self.atom_data_filename))
        self.config_yaml = yaml_load_config_file(
            'tardis/io/tests/data/tardis_configv1_verysimple.yml')
        self.config_yaml['atom_data'] = self.atom_data_filename

        tardis_config = Configuration.from_config_dict(self.config_yaml)
        self.simulation = Simulation.from_config(tardis_config)
        self.simulation.run()
Ejemplo n.º 5
0
    def runner(self, atomic_data_fname, tardis_ref_data, generate_reference):
        config = Configuration.from_yaml(
            'tardis/io/tests/data/tardis_configv1_verysimple.yml')
        config['atom_data'] = atomic_data_fname

        simulation = Simulation.from_config(config)
        simulation.run()

        if not generate_reference:
            return simulation.runner
        else:
            simulation.runner.hdf_properties = [
                'j_blue_estimator', 'spectrum', 'spectrum_virtual'
            ]
            simulation.runner.to_hdf(tardis_ref_data, '', self.name)
            pytest.skip('Reference data was generated during this run.')
Ejemplo n.º 6
0
    def runner(self, atomic_data_fname, tardis_ref_data, generate_reference):
        config = Configuration.from_yaml(
            "tardis/io/tests/data/tardis_configv1_verysimple.yml")
        config["atom_data"] = atomic_data_fname

        simulation = Simulation.from_config(config)
        simulation.run()

        if not generate_reference:
            return simulation.runner
        else:
            simulation.runner.hdf_properties = [
                "j_blue_estimator",
                "spectrum",
                "spectrum_virtual",
            ]
            simulation.runner.to_hdf(tardis_ref_data, "", self.name)
            pytest.skip("Reference data was generated during this run.")
    def runner(self, config, atomic_data_fname, tardis_ref_data,
               generate_reference):
        config.atom_data = atomic_data_fname

        self.name = self._name + f"_{config.plasma.line_interaction_type:s}"
        if config.spectrum.integrated.interpolate_shells > 0:
            self.name += "_interp"

        simulation = Simulation.from_config(config)
        simulation.run()

        if not generate_reference:
            return simulation.runner
        else:
            simulation.runner.hdf_properties = [
                "j_blue_estimator",
                "spectrum",
                "spectrum_integrated",
            ]
            simulation.runner.to_hdf(tardis_ref_data, "", self.name)
            pytest.skip("Reference data was generated during this run.")
Ejemplo n.º 8
0
    def runner(
            self, atomic_data_fname,
            tardis_ref_data, generate_reference):
        config = Configuration.from_yaml(
                'tardis/io/tests/data/tardis_configv1_verysimple.yml')
        config['atom_data'] = atomic_data_fname

        simulation = Simulation.from_config(config)
        simulation.run()

        if not generate_reference:
            return simulation.runner
        else:
            simulation.runner.hdf_properties = [
                    'j_blue_estimator',
                    'spectrum',
                    'spectrum_virtual'
                    ]
            simulation.runner.to_hdf(
                    tardis_ref_data,
                    '',
                    self.name)
            pytest.skip(
                    'Reference data was generated during this run.')