Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which Pandas version is required for new plasma framework? #415

Closed
unoebauer opened this issue Sep 28, 2015 · 1 comment · Fixed by #416
Closed

Which Pandas version is required for new plasma framework? #415

unoebauer opened this issue Sep 28, 2015 · 1 comment · Fixed by #416
Labels

Comments

@unoebauer
Copy link
Contributor

In the course of the plasma rewrite, it seems that the pandas dependencies have changed: before pandas 0.14.1 was sufficient to run Tardis smoothly, now I need a newer version of this library to avoid the following slicing errors in the plasma part:

tardis.io.config_reader - INFO - Reading Atomic Data from kurucz_cd23_chianti_H_He.h5
tardis.atomic - INFO - Read Atom Data with UUID=5ca3035ca8b311e3bb684437e69d75d7 and MD5=21095dd25faa1683f4c90c911a00c3f8
tardis.io.config_reader - INFO - "initial_t_inner" is not specified in the plasma section - initializing to 9933.95199592 K with given luminosity
tardis.io.config_reader - WARNING - No "species" given - ignoring other NLTE options given:
{   'classical_nebular': False, 'coronal_approximation': False}
tardis.io.config_reader - WARNING - No convergence criteria selected - just damping by 0.5 for w, t_rad and t_inner
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-18da1eb56fae> in <module>()
----> 1 mdl = run_tardis(config)

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/base.pyc in run_tardis(config, atom_data)
     38     tardis_config = config_reader.Configuration.from_config_dict(
     39         config_dict, atom_data=atom_data)
---> 40     radial1d_mdl = model.Radial1DModel(tardis_config)
     41 
     42     simulation.run_radial1d(radial1d_mdl)

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/model.pyc in __init__(self, tardis_config)
    129                                                          heating_rate_data_file=heating_rate_data_file,
    130                                                          v_inner=tardis_config.structure.v_inner,
--> 131                                                          v_outer=tardis_config.structure.v_outer)
    132 
    133         self.spectrum = TARDISSpectrum(tardis_config.spectrum.frequency, tardis_config.supernova.distance)

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/plasma/standard_plasmas.pyc in __init__(self, number_densities, atomic_data, time_explosion, t_rad, delta_treatment, nlte_config, ionization_mode, excitation_mode, line_interaction_type, link_t_rad_t_electron, helium_treatment, heating_rate_data_file, v_inner, v_outer)
    129             abundance=abundance, density=density,
    130             atomic_data=atomic_data, time_explosion=time_explosion,
--> 131             j_blues=None, w=w, link_t_rad_t_electron=link_t_rad_t_electron)

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/plasma/base.pyc in __init__(self, plasma_properties, **kwargs)
     20         self._build_graph()
     21 #        self.write_to_tex('Plasma_Graph')
---> 22         self.update(**kwargs)
     23 
     24     def __getattr__(self, item):

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/plasma/base.pyc in update(self, **kwargs)
    145 
    146         for module_name in self._resolve_update_list(kwargs.keys()):
--> 147             self.plasma_properties_dict[module_name].update()
    148 
    149     def _update_module_type_str(self):

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/plasma/properties/base.pyc in update(self)
     95         if len(self.outputs) == 1:
     96             setattr(self, self.outputs[0], self.calculate(
---> 97                 *self._get_input_values()))
     98         else:
     99             new_values = self.calculate(*self._get_input_values())

/home/ulrich/python-virtualenv/tardis/local/lib/python2.7/site-packages/tardis_sn-1.0.1-py2.7-linux-x86_64.egg/tardis/plasma/properties/ion_population.pyc in calculate(g_electron, beta_rad, partition_function, ionization_data)
     55             current_block = partition_function.values[start_id:end_id]
     56             current_phis = current_block[1:] / current_block[:-1]
---> 57             phis[start_id - i:end_id - i - 1] = current_phis
     58 
     59         broadcast_ionization_energy = (

ValueError: could not broadcast input array from shape (93,20) into shape (88,20)

Using the latest version of pandas available via pip, pandas 0.16.2, resolves this issue and allows me to run Tardis again smoothly. A similar discussion took place in the course of PR #399

These statements are all based on the tardis_example run and on tests performed only on my laptop, running Debian Jessie.

If indeed pandas >= 0.16 is needed, the requirements should be updated.

@unoebauer
Copy link
Contributor Author

This means that pandas 0.16 is indeed needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant