Skip to content

Commit

Permalink
Substitute changing to float64 dtype using map with base functionalit…
Browse files Browse the repository at this point in the history
…y that's accessible across Pandas versions
  • Loading branch information
matsuobasho committed Nov 6, 2023
1 parent 69b3bc2 commit 64c3217
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pvlib/tests/test_singlediode.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,11 @@ def build_precise_iv_curve_dataframe(file_csv, file_json):

# parse strings to np.float64
is_array = ['Currents', 'Voltages', 'diode_voltage']
joined[is_array] = joined[is_array].map(
lambda a: np.asarray(a, dtype=np.float64)
)
for col in is_array:
joined[col] = [np.asarray(a, dtype=np.float64) for a in joined[col]]
is_number = ['v_oc', 'i_sc', 'v_mp', 'i_mp', 'p_mp', 'i_x', 'i_xx',
'Temperature']
joined[is_number] = joined[is_number].map(np.float64)
joined[is_number] = joined[is_number].astype(np.float64)

joined['Boltzmann'] = scipy.constants.Boltzmann
joined['Elementary Charge'] = scipy.constants.elementary_charge
Expand Down

0 comments on commit 64c3217

Please sign in to comment.