Skip to content

Commit

Permalink
Run black formatting on files
Browse files Browse the repository at this point in the history
  • Loading branch information
KasukabeDefenceForce committed Oct 7, 2024
1 parent 850112f commit 8a145a3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion tardis/energy_input/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ def doppler_factor_3d(direction_vector, position_vector, time):
velocity_vector = position_vector / time
direction_vector_contiguous = np.ascontiguousarray(direction_vector)
velocity_vector_contiguous = np.ascontiguousarray(velocity_vector)
return 1 - (np.dot(direction_vector_contiguous, velocity_vector_contiguous) / C_CGS)
return 1 - (

Check warning on line 75 in tardis/energy_input/util.py

View check run for this annotation

Codecov / codecov/patch

tardis/energy_input/util.py#L73-L75

Added lines #L73 - L75 were not covered by tests
np.dot(direction_vector_contiguous, velocity_vector_contiguous) / C_CGS
)


@njit(**njit_dict_no_parallel)
Expand Down
8 changes: 7 additions & 1 deletion tardis/io/model/parse_radiation_field_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,13 @@ def calculate_geometric_dilution_factor(geometry):
The dilution factors for the inout geometry
"""
value = (
1 - (geometry.r_inner[geometry.v_inner_boundary_index] ** 2 / geometry.r_middle**2).to(1).value
1
- (
geometry.r_inner[geometry.v_inner_boundary_index] ** 2
/ geometry.r_middle**2
)
.to(1)
.value
)
value = np.clip(value, 0, None)
return 0.5 * (1 - np.sqrt(value))
2 changes: 1 addition & 1 deletion tardis/model/matter/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(

def assemble_isotope_masses(self):
isotope_mass_df = pd.Series(
index=self.isotopic_mass_fraction.index, data=-1,dtype="float64"
index=self.isotopic_mass_fraction.index, data=-1, dtype="float64"
)
for isotope_tuple in self.isotopic_mass_fraction.index:
isotope_symbol = int("{:03d}{:03d}0000".format(*isotope_tuple))
Expand Down
2 changes: 1 addition & 1 deletion tardis/plasma/properties/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ def exp1_times_exp(x):
Output array.
"""
x = np.asarray(x)
f = exp1(x) * np.exp(x, where=x<=500)
f = exp1(x) * np.exp(x, where=x <= 500)
# Use Laurent series for large values to avoid infinite exponential
mask = x > 500
f[mask] = (x**-1 - x**-2 + 2 * x**-3 - 6 * x**-4)[mask]
Expand Down
4 changes: 1 addition & 3 deletions tardis/plasma/properties/nlte_rate_equation_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,7 @@ def calculate_first_guess(
"""
first_guess = pd.Series(0.0, index=rate_matrix_index)
for atomic_number in atomic_numbers:
first_guess.at[(atomic_number, 1)] = number_density.loc[
atomic_number
]
first_guess.at[(atomic_number, 1)] = number_density.loc[atomic_number]
# TODO: After the first iteration, the new guess can be the old solution.
first_guess = first_guess.values
first_guess[-1] = electron_density
Expand Down

0 comments on commit 8a145a3

Please sign in to comment.