diff --git a/beep/__init__.py b/beep/__init__.py index 1e42fef8..08c16399 100644 --- a/beep/__init__.py +++ b/beep/__init__.py @@ -21,7 +21,7 @@ # Versioning. The python code version is frequently tagged # with a commit hash from the repo, which is supplied via # an environment variable by the integration build procedure -__version__ = "2022.10.3.16" +__version__ = "2025.1.29.19" VERSION_TAG = os.environ.get("BEEP_VERSION_TAG") if VERSION_TAG is not None: __version__ = "-".join([__version__, VERSION_TAG]) diff --git a/beep/features/core.py b/beep/features/core.py index c865365e..6db4addf 100644 --- a/beep/features/core.py +++ b/beep/features/core.py @@ -788,7 +788,8 @@ def create_features(self): parameters_path = self.hyperparameters["parameters_dir"] cycle_types = self.datapath.diagnostic_summary.cycle_type.unique() - X = pd.DataFrame() + # X = pd.DataFrame() + summary_diag_cycle_type_list = [] for quantity in self.hyperparameters["quantities"]: for cycle_type in cycle_types: summary_diag_cycle_type = featurizer_helpers.get_fractional_quantity_remaining_nx( @@ -798,8 +799,9 @@ def create_features(self): summary_diag_cycle_type.loc[:, "cycle_type"] = cycle_type summary_diag_cycle_type.loc[:, "metric"] = quantity - X = X.append(summary_diag_cycle_type) + summary_diag_cycle_type_list.append(summary_diag_cycle_type) + X = pd.concat(summary_diag_cycle_type_list) X_condensed = self.get_threshold_targets(X) self.features = X_condensed diff --git a/beep/features/featurizer_helpers.py b/beep/features/featurizer_helpers.py index 6e2519c6..257d1c67 100644 --- a/beep/features/featurizer_helpers.py +++ b/beep/features/featurizer_helpers.py @@ -189,8 +189,8 @@ def get_resistance_soc_duration_hppc(processed_cycler_run, diag_pos): # full name f_name = name + '_' + str(j) df_row[f_name] = [res_calc(chosen, j, name)] - output = output.append(df_row, ignore_index=True) - return output + output = pd.concat([output, df_row], ignore_index=True) + return df_row def get_dr_df(processed_cycler_run, diag_pos): diff --git a/beep/protocol/maccor.py b/beep/protocol/maccor.py index a8536d36..511c3e6e 100644 --- a/beep/protocol/maccor.py +++ b/beep/protocol/maccor.py @@ -1082,6 +1082,7 @@ def insert_hppc_cyclev2(self, start, nominal_capacity, diagnostic_params): # Initial charge step for hppc cycle assert steps[start]["StepType"] == "Charge" assert steps[start]["StepMode"] == "Current" + # TODO: fix float warning - need a switch between DF and numpy representations steps[start]["StepValue"] = float( round( nominal_capacity * diagnostic_params["HPPC_baseline_constant_current"], @@ -1101,7 +1102,7 @@ def insert_hppc_cyclev2(self, start, nominal_capacity, diagnostic_params): assert steps[start + 2]["Ends"]["EndEntry"][0]["EndType"] == "StepTime" time_s = int(round(60 * diagnostic_params["HPPC_rest_time"])) steps[start + 2]["Ends"]["EndEntry"][0]["Value"] = time.strftime( - "%H:%M:%S", time.gmtime(time_s) + "%H:%M:%S", time.gmtime(float(time_s)) ) # Discharge step 1 for hppc cycle @@ -1113,7 +1114,7 @@ def insert_hppc_cyclev2(self, start, nominal_capacity, diagnostic_params): assert steps[start + 3]["Ends"]["EndEntry"][0]["EndType"] == "StepTime" time_s = diagnostic_params["HPPC_pulse_duration_1"] steps[start + 3]["Ends"]["EndEntry"][0]["Value"] = time.strftime( - "%H:%M:%S", time.gmtime(time_s) + "%H:%M:%S", time.gmtime(float(time_s)) ) assert steps[start + 3]["Ends"]["EndEntry"][1]["EndType"] == "Voltage" steps[start + 3]["Ends"]["EndEntry"][1]["Value"] = float( @@ -1137,7 +1138,7 @@ def insert_hppc_cyclev2(self, start, nominal_capacity, diagnostic_params): assert steps[start + 5]["Ends"]["EndEntry"][0]["EndType"] == "StepTime" time_s = diagnostic_params["HPPC_pulse_duration_2"] steps[start + 5]["Ends"]["EndEntry"][0]["Value"] = time.strftime( - "%H:%M:%S", time.gmtime(time_s) + "%H:%M:%S", time.gmtime(float(time_s)) ) assert steps[start + 5]["Ends"]["EndEntry"][1]["EndType"] == "Voltage" steps[start + 5]["Ends"]["EndEntry"][1]["Value"] = float( @@ -1163,7 +1164,7 @@ def insert_hppc_cyclev2(self, start, nominal_capacity, diagnostic_params): ) ) steps[start + 6]["Ends"]["EndEntry"][0]["Value"] = time.strftime( - "%H:%M:%S", time.gmtime(time_s) + "%H:%M:%S", time.gmtime(float(time_s)) ) assert steps[start + 6]["Ends"]["EndEntry"][1]["EndType"] == "Voltage" steps[start + 6]["Ends"]["EndEntry"][1]["Value"] = float( diff --git a/beep/protocol/maccor_to_arbin.py b/beep/protocol/maccor_to_arbin.py index 0a42a765..2a10fe45 100644 --- a/beep/protocol/maccor_to_arbin.py +++ b/beep/protocol/maccor_to_arbin.py @@ -294,7 +294,8 @@ def compile_to_arbin( blank_step["m_szCtrlValue"] = "0" blank_step["m_szExtCtrlValue1"] = str(2 ** loop_counter) blank_step["m_szExtCtrlValue2"] = "0" - assert isinstance(step_abs["Ends"]["EndEntry"], OrderedDict) + # TODO: is this necessary post 3.7? + # assert isinstance(step_abs["Ends"]["EndEntry"], OrderedDict) loop_addendum = OrderedDict( [ ("EndType", "Loop Addendum"), @@ -361,7 +362,7 @@ def compile_to_arbin( # Reports if step_abs["Reports"] is not None: - if isinstance(step_abs["Reports"]["ReportEntry"], OrderedDict): + if isinstance(step_abs["Reports"]["ReportEntry"], dict): blank_step["m_uLimitNum"] = blank_step["m_uLimitNum"] + 1 report = step_abs["Reports"]["ReportEntry"] report_index = 0 diff --git a/setup.py b/setup.py index 17e8868b..f142cbdb 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup(name="beep", url="https://github.com/TRI-AMDD/beep", - version="2022.10.3.16", + version="2025.1.29.19", description=description, long_description=long_description, long_description_content_type='text/markdown',