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

Replace with appropriate .loc or .iloc method. #2969

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ Ran Livneh <ran.livneh@weizmann.ac.il> Ran Livneh <livnehra@gmail.com>
Ryan Groneck <GroneckR@msu.edu>
Ryan Groneck <GroneckR@msu.edu> RyanGroneck <GroneckR@msu.edu>

Rohit Prasad <rohitprasad20022@gmail.com>

Sampark Sharma <samparksharma2000@gmail.com>

Shilpi Prasad <shilpiprd@gmail.com>
Expand Down
16 changes: 8 additions & 8 deletions tardis/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ def onpick(event):
print(
"Line_in"
f"({len(event.ind)}/{self.current_no_packets})"
f":\n{self.last_line_list_in.ix[event.ind]}"
f":\n{self.last_line_list_in.iloc[event.ind]}"
)
print("\n\n")
print(
"Line_out"
f"({len(event.ind)}/{self.current_no_packets})"
f":\n{self.last_line_list_in.ix[event.ind]}"
f":\n{self.last_line_list_in.iloc[event.ind]}"
)
print("^" * 80)

Expand Down Expand Up @@ -306,7 +306,7 @@ def load_t_inner(self, iterations=None):

for iter in iterations:
t_inners.append(
hdf_store[f"model{iter:03d}/configuration"].ix["t_inner"]
hdf_store[f"model{iter:03d}/configuration"].iloc["t_inner"]
)
hdf_store.close()

Expand Down Expand Up @@ -435,7 +435,7 @@ def calculate_relative_lte_level_populations(self, species, iteration=-1):
t_rads = self.load_t_rads(iteration)
beta_rads = 1 / (constants.k_B.cgs.value * t_rads.values[:, 0])

species_levels = self.levels.ix[species]
species_levels = self.levels.iloc[species]

relative_lte_level_populations = (
species_levels.g.values[np.newaxis].T
Expand All @@ -451,14 +451,14 @@ def calculate_departure_coefficients(self, species, iteration=-1):
t_rads = self.load_t_rads(iteration)
beta_rads = 1 / (constants.k_B.cgs.value * t_rads.values[:, 0])

species_levels = self.levels.ix[species]
species_level_populations = self.load_level_populations(iteration).ix[
species_levels = self.levels.iloc[species]
species_level_populations = self.load_level_populations(iteration).iloc[
species
]
departure_coefficient = (
(species_level_populations.values * species_levels.g.ix[0])
(species_level_populations.values * species_levels.g.iloc[0])
/ (
species_level_populations.ix[0].values
species_level_populations.iloc[0].values
* species_levels.g.values[np.newaxis].T
)
) * np.exp(beta_rads * species_levels.energy.values[np.newaxis].T)
Expand Down
Loading