diff --git a/cellpy/cli.py b/cellpy/cli.py index 49b586d2..caed43fa 100644 --- a/cellpy/cli.py +++ b/cellpy/cli.py @@ -1737,7 +1737,7 @@ def _new( else: selected_project_dir = None - click.echo(f"Select another directory instead") + click.echo("Select another directory instead") CREATE_NEW_DIR = "Create new project..." if not selected_project_dir: project_dirs = [ @@ -1745,9 +1745,7 @@ def _new( for d in directory.iterdir() if d.is_dir() and not d.name.startswith(".") ] - print(f"project_dirs: {project_dirs}") project_dirs.insert(0, CREATE_NEW_DIR) - print(f"project_dirs: {project_dirs}") project_dir = cookiecutter.prompt.read_user_choice( "project folder", project_dirs diff --git a/cellpy/utils/batch_tools/batch_journals.py b/cellpy/utils/batch_tools/batch_journals.py index 6937383d..e1ca3b3f 100644 --- a/cellpy/utils/batch_tools/batch_journals.py +++ b/cellpy/utils/batch_tools/batch_journals.py @@ -219,7 +219,7 @@ def from_db(self, project=None, name=None, batch_col=None, dbreader_kwargs=None, self.pages = self.engine(self.db_reader, batch_name=name, **kwargs) if self.pages.empty: - logging.critical(f"EMPTY JOURNAL: are you sure you have provided correct input to batch?") + logging.critical("EMPTY JOURNAL: are you sure you have provided correct input to batch?") logging.critical(f"name: {name}") logging.critical(f"project: {self.project}") logging.critical(f"batch_col: {batch_col}") diff --git a/cellpy/utils/collectors.py b/cellpy/utils/collectors.py index ea806c32..47de400a 100644 --- a/cellpy/utils/collectors.py +++ b/cellpy/utils/collectors.py @@ -131,15 +131,15 @@ def generate_output_path(name, directory, serial_number=None): f = d / name return f -def incremental_image_exporter_plotly(self, filename, timeout=IMAGE_TO_FILE_TIMEOUT, **kwargs): +def incremental_image_exporter_plotly(figure, filename, timeout=IMAGE_TO_FILE_TIMEOUT, **kwargs): use_subprocess = kwargs.pop("use_subprocess", True) if not use_subprocess: print(f"saving image to {filename}") - self.figure.write_image(filename, **kwargs) + figure.write_image(filename, **kwargs) return p = Process( - target=self.figure.write_image, + target=figure.write_image, args=(filename,), name="save_plotly_image_to_file", kwargs=kwargs, @@ -818,6 +818,8 @@ def save(self, serial_number=None, save_hdf5=True, save_image_files=True, to_csv if self._figure_valid(): if save_image_files: + if to_image_files_kwargs is None: + to_image_files_kwargs = {} self.to_image_files(serial_number=serial_number, **to_image_files_kwargs) def _output_path(self, serial_number=None): diff --git a/cellpy/utils/helpers.py b/cellpy/utils/helpers.py index 10d09719..79de3f2a 100644 --- a/cellpy/utils/helpers.py +++ b/cellpy/utils/helpers.py @@ -1369,7 +1369,7 @@ def select_summary_based_on_rate( step_table = cell.data.steps if partition_by_cv: - summary = _partition_summary_based_on_cv_steps(cell.data.summary) + summary = _partition_summary_based_on_cv_steps(cell) else: summary = cell.data.summary @@ -1380,7 +1380,7 @@ def select_summary_based_on_rate( summary.set_index(cycle_number_header, drop=True, inplace=True) else: print(f"{cycle_number_header} not set as index!") - print(f"Please, set the cycle index header as index before proceeding!") + print("Please, set the cycle index header as index before proceeding!") return summary if on: @@ -1437,7 +1437,7 @@ def add_normalized_capacity(cell, norm_cycles=None, individual_normalization=Fal try: norm_val_charge = cell.data.summary.loc[norm_cycles, col_name_charge].mean() except KeyError as e: - print(f"Oh no! Are you sure these cycle indexes exist?") + print("Oh no! Are you sure these cycle indexes exist?") print(f" norm_cycles: {norm_cycles}") print(f" cycle indexes: {list(cell.data.summary.index)}") raise KeyError from e diff --git a/cellpy/utils/plotutils.py b/cellpy/utils/plotutils.py index 119ac8a7..a7f5692d 100644 --- a/cellpy/utils/plotutils.py +++ b/cellpy/utils/plotutils.py @@ -1782,6 +1782,8 @@ def _calculate_seaborn_plot_properties(number_of_rows, number_of_cols, plot_type if fullcell_standard_normalization_type is not False: cum_loss_info_range = norm_range or [0.0, max(max_val_normalized_col, fullcell_standard_normalization_scaler)] + else: + cum_loss_info_range = norm_range or y_range cv_info = dict( title="", diff --git a/tests/test_ica.py b/tests/test_ica.py index 4ba714d5..baacd2ab 100644 --- a/tests/test_ica.py +++ b/tests/test_ica.py @@ -179,7 +179,7 @@ def test_dqdv_multi_cycles_tidy(dataset): assert "voltage" in df_ica.columns assert "cycle" in df_ica.columns assert "dq" in df_ica.columns - assert df_ica.size == 26379 + assert df_ica.size == 26667 def test_dqdv_multi_cycles_wide(dataset): @@ -189,7 +189,7 @@ def test_dqdv_multi_cycles_wide(dataset): assert cycles_available.issuperset(cycles_processed) assert "voltage" in df_ica.columns.get_level_values(1) assert "dq" in df_ica.columns.get_level_values(1) - assert df_ica.size == 37536 + assert df_ica.size == 39744 # TODO - aulv: this test should be un-commented when hist-method