diff --git a/docs/physics/plasma/plasma_plots/lte_ionization_balance.py b/docs/physics/plasma/plasma_plots/lte_ionization_balance.py index 097730ca7b2..47c13a57647 100644 --- a/docs/physics/plasma/plasma_plots/lte_ionization_balance.py +++ b/docs/physics/plasma/plasma_plots/lte_ionization_balance.py @@ -40,7 +40,7 @@ # Initializing a dataframe to store the ion populations and level populations for the different temperatures ion_number_densities = pd.DataFrame(index=lte_plasma.ion_populations.index) level_populations = pd.DataFrame( - index=lte_plasma.level_populations.ix[14, 1].index + index=lte_plasma.level_populations.loc[14, 1].index ) t_rads = np.linspace(2000, 20000, 100) @@ -54,19 +54,19 @@ ion_number_densities[t_rad] = ion_density # normalizing the level_populations for Si II - current_level_population = lte_plasma.level_populations[0].ix[ + current_level_population = lte_plasma.level_populations[0].loc[ 14, 1 ] / lte_plasma.ion_populations.get_value((14, 1), 0) # normalizing with statistical weight - current_level_population /= atom_data.levels.ix[14, 1].g + current_level_population /= atom_data.levels.loc[14, 1].g level_populations[t_rad] = current_level_population ion_colors = ["b", "g", "r", "k"] for ion_number in [0, 1, 2, 3]: - current_ion_density = ion_number_densities.ix[14, ion_number] + current_ion_density = ion_number_densities.loc[14, ion_number] ax1.plot( current_ion_density.index, current_ion_density.values, diff --git a/docs/physics/plasma/plasma_plots/nebular_ionization_balance.py b/docs/physics/plasma/plasma_plots/nebular_ionization_balance.py index ed008f60e3a..5acaa11327a 100644 --- a/docs/physics/plasma/plasma_plots/nebular_ionization_balance.py +++ b/docs/physics/plasma/plasma_plots/nebular_ionization_balance.py @@ -38,7 +38,7 @@ # Initializing a dataframe to store the ion populations and level populations for the different temperatures ion_number_densities = pd.DataFrame(index=nebular_plasma.ion_populations.index) level_populations = pd.DataFrame( - index=nebular_plasma.level_populations.ix[14, 1].index + index=nebular_plasma.level_populations.loc[14, 1].index ) t_rads = np.linspace(2000, 20000, 100) @@ -53,18 +53,18 @@ # normalizing the level_populations for Si II current_level_population = ( - nebular_plasma.level_populations.ix[14, 1] - / nebular_plasma.ion_populations.ix[14, 1] + nebular_plasma.level_populations.loc[14, 1] + / nebular_plasma.ion_populations.loc[14, 1] ) # normalizing with statistical weight - current_level_population /= atom_data.levels.ix[14, 1].g + current_level_population /= atom_data.levels.loc[14, 1].g level_populations[t_rad] = current_level_population ion_colors = ["b", "g", "r", "k"] for ion_number in [0, 1, 2, 3]: - current_ion_density = ion_number_densities.ix[14, ion_number] + current_ion_density = ion_number_densities.loc[14, ion_number] ax1.plot( current_ion_density.index, current_ion_density.values, @@ -98,11 +98,11 @@ # normalizing the level_populations for Si II current_level_population = ( - nebular_plasma.level_populations.ix[14, 1] - / nebular_plasma.ion_populations.ix[14, 1] + nebular_plasma.level_populations.loc[14, 1] + / nebular_plasma.ion_populations.loc[14, 1] ) # normalizing with statistical weight - current_level_population /= atom_data.levels.ix[14, 1].g + current_level_population /= atom_data.levels.loc[14, 1].g level_populations[t_rad] = current_level_population @@ -110,7 +110,7 @@ for ion_number in [0, 1, 2, 3]: print("w=0.5") - current_ion_density = ion_number_densities.ix[14, ion_number] + current_ion_density = ion_number_densities.loc[14, ion_number] ax1.plot( current_ion_density.index, current_ion_density.values, diff --git a/tardis/io/parsers/csvy.py b/tardis/io/parsers/csvy.py index fcb5c175019..b54bc1bf379 100644 --- a/tardis/io/parsers/csvy.py +++ b/tardis/io/parsers/csvy.py @@ -38,7 +38,7 @@ def load_csvy(fname): yaml_dict = yaml.load("".join(yaml_lines[1:-1]), YAMLLoader) try: data = pd.read_csv(fname, skiprows=yaml_end_ind + 1) - except pd.io.common.EmptyDataError as e: + except pd.errors.EmptyDataError as e: data = None return yaml_dict, data diff --git a/tardis/plasma/properties/atomic.py b/tardis/plasma/properties/atomic.py index 3e1c7014a7d..6683670bfb3 100644 --- a/tardis/plasma/properties/atomic.py +++ b/tardis/plasma/properties/atomic.py @@ -226,8 +226,8 @@ class ZetaData(BaseAtomicDataProperty): outputs = ("zeta_data",) def _filter_atomic_property(self, zeta_data, selected_atoms): - zeta_data["atomic_number"] = zeta_data.index.labels[0] + 1 - zeta_data["ion_number"] = zeta_data.index.labels[1] + 1 + zeta_data["atomic_number"] = zeta_data.index.codes[0] + 1 + zeta_data["ion_number"] = zeta_data.index.codes[1] + 1 zeta_data = zeta_data[zeta_data.atomic_number.isin(selected_atoms)] zeta_data_check = counter(zeta_data.atomic_number.values) keys = np.array(list(zeta_data_check.keys())) diff --git a/tardis/plasma/properties/partition_function.py b/tardis/plasma/properties/partition_function.py index 204ede31aa4..e9b9899c30c 100644 --- a/tardis/plasma/properties/partition_function.py +++ b/tardis/plasma/properties/partition_function.py @@ -248,7 +248,7 @@ def _main_nlte_calculation( ) else: raise e - general_level_boltzmann_factor[i].ix[species] = ( + general_level_boltzmann_factor[i].loc[species] = ( level_boltzmann_factor * g.loc[species][0] / level_boltzmann_factor[0] diff --git a/tardis_env3.yml b/tardis_env3.yml index 27d1f4b3e6c..606761b722c 100644 --- a/tardis_env3.yml +++ b/tardis_env3.yml @@ -8,7 +8,7 @@ dependencies: - pip - numpy=1.16 - scipy=1.5 - - pandas=0.24 + - pandas=1.0 - astropy=3 - numba=0.50 - numexpr