From ee716b2a9bd7680b3c40c323e91f54b190418570 Mon Sep 17 00:00:00 2001 From: Leonardo Schwarz Date: Wed, 19 Jun 2024 14:37:37 +0200 Subject: [PATCH] formatting --- src/depiction/tools/simulate/synthetic_msi_data_generator.py | 1 + src/depiction_targeted_preproc/pipeline_config/model.py | 4 ++-- .../workflow/qc/plot_calibration_map.py | 4 +++- .../workflow/qc/plot_calibration_map_v2.py | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/depiction/tools/simulate/synthetic_msi_data_generator.py b/src/depiction/tools/simulate/synthetic_msi_data_generator.py index 6b64ab1..c6712be 100644 --- a/src/depiction/tools/simulate/synthetic_msi_data_generator.py +++ b/src/depiction/tools/simulate/synthetic_msi_data_generator.py @@ -12,6 +12,7 @@ # TODO configure shifts + class SyntheticMSIDataGenerator: """Helper that creates synthetic MSI data.""" diff --git a/src/depiction_targeted_preproc/pipeline_config/model.py b/src/depiction_targeted_preproc/pipeline_config/model.py index 7c87854..f3e360e 100644 --- a/src/depiction_targeted_preproc/pipeline_config/model.py +++ b/src/depiction_targeted_preproc/pipeline_config/model.py @@ -93,8 +93,8 @@ class SimulateParameters(Model): image_height: int = 100 n_labels: int = 30 bin_width_ppm: float = 100.0 - target_mass_min: float = 850. - target_mass_max: float = 1900. + target_mass_min: float = 850.0 + target_mass_max: float = 1900.0 class PipelineArtifact(str, Enum): diff --git a/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map.py b/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map.py index 7f59b1f..6c171c7 100644 --- a/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map.py +++ b/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map.py @@ -41,7 +41,9 @@ def qc_plot_calibration_map( vis_shifts = VisualizeMassShiftMap(models=models, coordinates=coords_2d) # TODO fix same_scale - fig, axs = vis_shifts.plot_test_mass_maps_and_histograms(test_masses=test_masses, same_scale=True, int_limits=(-.25, .25)) + fig, axs = vis_shifts.plot_test_mass_maps_and_histograms( + test_masses=test_masses, same_scale=True, int_limits=(-0.25, 0.25) + ) fig.savefig(output_pdf) fig.clear() diff --git a/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map_v2.py b/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map_v2.py index e62af79..1cae977 100644 --- a/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map_v2.py +++ b/src/depiction_targeted_preproc/workflow/qc/plot_calibration_map_v2.py @@ -16,14 +16,14 @@ def qc_plot_calibration_map_v2( fig, axs = plt.subplots(2, 1, figsize=(10, 20)) # show the map - mass_shifts.isel(c=0).plot.imshow(x="x", y="y", ax=axs[0], cmap="coolwarm", vmin=-0.5, vmax=+.5) + mass_shifts.isel(c=0).plot.imshow(x="x", y="y", ax=axs[0], cmap="coolwarm", vmin=-0.5, vmax=+0.5) axs[0].set_aspect("equal") test_mass = mass_shifts.coords["c"][0] axs[0].set_title(f"Computed shift for test mass {test_mass:.2f}") # show the histogram # TODO the clipping could be misleading (as it's not indicated) - mass_shifts.isel(c=0).clip(-.5, .5).plot.hist(ax=axs[1], bins=100, color="gray") + mass_shifts.isel(c=0).clip(-0.5, 0.5).plot.hist(ax=axs[1], bins=100, color="gray") axs[1].set_title("Histogram of computed shifts") plt.savefig(output_pdf, bbox_inches="tight")