From 3ecbc0c2a4a72e083419abbcbfd03f85ac9c1fb9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:29:18 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black: 23.10.0 → 24.1.1](https://github.com/psf/black/compare/23.10.0...24.1.1) - [github.com/PyCQA/isort: 5.12.0 → 5.13.2](https://github.com/PyCQA/isort/compare/5.12.0...5.13.2) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 82e47588f..a9131a749 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,11 +12,11 @@ ci: repos: - repo: https://github.com/psf/black - rev: 23.10.0 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort additional_dependencies: [tomli] # to read config from pyproject.toml From d7537551cc5d9c3ad57da5c3545cada66c8ff89b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:30:00 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- geoapps/block_model_creation/driver.py | 6 +++--- geoapps/inversion/base_inversion_application.py | 12 ++++-------- .../components/factories/directives_factory.py | 8 +++++--- .../inversion/components/factories/survey_factory.py | 12 ++++++------ geoapps/inversion/electromagnetics/application.py | 6 +++--- geoapps/utils/models.py | 6 +++--- 6 files changed, 24 insertions(+), 26 deletions(-) diff --git a/geoapps/block_model_creation/driver.py b/geoapps/block_model_creation/driver.py index 5463819db..dc231b131 100644 --- a/geoapps/block_model_creation/driver.py +++ b/geoapps/block_model_creation/driver.py @@ -47,9 +47,9 @@ def truncate_locs_depths(locs: np.ndarray, depth_core: float) -> np.ndarray: zmax = locs[:, -1].max() # top of locs below_core_ind = (zmax - locs[:, -1]) > depth_core core_bottom_elev = zmax - depth_core - locs[ - below_core_ind, -1 - ] = core_bottom_elev # sets locations below core to core bottom + locs[below_core_ind, -1] = ( + core_bottom_elev # sets locations below core to core bottom + ) return locs @staticmethod diff --git a/geoapps/inversion/base_inversion_application.py b/geoapps/inversion/base_inversion_application.py index 7f47fc7e4..bbb7a23ae 100644 --- a/geoapps/inversion/base_inversion_application.py +++ b/geoapps/inversion/base_inversion_application.py @@ -1362,14 +1362,10 @@ def get_full_component_params( param_dict[comp + "_uncertainty"] = value["uncertainty_floor"] elif value["uncertainty_type"] == "Channel": if is_uuid(value["uncertainty_channel"]): - param_dict[ - comp + "_uncertainty" - ] = self.workspace.get_entity( - uuid.UUID(value["uncertainty_channel"]) - )[ - 0 - ].copy( - parent=data_object, copy_children=False + param_dict[comp + "_uncertainty"] = ( + self.workspace.get_entity( + uuid.UUID(value["uncertainty_channel"]) + )[0].copy(parent=data_object, copy_children=False) ) else: param_dict[comp + "_channel_bool"] = False diff --git a/geoapps/inversion/components/factories/directives_factory.py b/geoapps/inversion/components/factories/directives_factory.py index 79579f06e..7c229265f 100644 --- a/geoapps/inversion/components/factories/directives_factory.py +++ b/geoapps/inversion/components/factories/directives_factory.py @@ -185,9 +185,11 @@ def update_irls_directive(self): coolEps_q=self.params.coolEps_q, coolEpsFact=self.params.coolEpsFact, beta_search=self.params.beta_search, - chifact_start=self.params.starting_chi_factor - if has_chi_start - else self.params.chi_factor, + chifact_start=( + self.params.starting_chi_factor + if has_chi_start + else self.params.chi_factor + ), chifact_target=self.params.chi_factor, ) return self._update_irls_directive diff --git a/geoapps/inversion/components/factories/survey_factory.py b/geoapps/inversion/components/factories/survey_factory.py index 7dfabde77..c595d3a2f 100644 --- a/geoapps/inversion/components/factories/survey_factory.py +++ b/geoapps/inversion/components/factories/survey_factory.py @@ -230,9 +230,9 @@ def _add_data(self, survey, data, local_index, channel): data_vec = self._stack_channels(local_data, "row") uncertainty_vec = self._stack_channels(local_uncertainties, "row") uncertainty_vec[np.isnan(data_vec)] = np.inf - data_vec[ - np.isnan(data_vec) - ] = self.dummy # Nan's handled by inf uncertainties + data_vec[np.isnan(data_vec)] = ( + self.dummy + ) # Nan's handled by inf uncertainties survey.dobs = data_vec survey.std = uncertainty_vec @@ -250,9 +250,9 @@ def _add_data(self, survey, data, local_index, channel): data_vec = self._stack_channels(local_data, "column") uncertainty_vec = self._stack_channels(local_uncertainties, "column") uncertainty_vec[np.isnan(data_vec)] = np.inf - data_vec[ - np.isnan(data_vec) - ] = self.dummy # Nan's handled by inf uncertainties + data_vec[np.isnan(data_vec)] = ( + self.dummy + ) # Nan's handled by inf uncertainties survey.dobs = data_vec survey.std = uncertainty_vec diff --git a/geoapps/inversion/electromagnetics/application.py b/geoapps/inversion/electromagnetics/application.py index 6d23d8040..724eafcbc 100644 --- a/geoapps/inversion/electromagnetics/application.py +++ b/geoapps/inversion/electromagnetics/application.py @@ -1212,9 +1212,9 @@ def write_trigger(self, _): if self.inversion_parameters.beta_start_options.value == "value": input_dict["initial_beta"] = self.inversion_parameters.beta_start.value else: - input_dict[ - "initial_beta_ratio" - ] = self.inversion_parameters.beta_start.value + input_dict["initial_beta_ratio"] = ( + self.inversion_parameters.beta_start.value + ) input_dict["tol_cg"] = self.inversion_parameters.tol_cg.value input_dict["ignore_values"] = self.inversion_parameters.ignore_values.value diff --git a/geoapps/utils/models.py b/geoapps/utils/models.py index 3827f2ea2..861cc32a9 100644 --- a/geoapps/utils/models.py +++ b/geoapps/utils/models.py @@ -425,9 +425,9 @@ def truncate_locs_depths(locs: np.ndarray, depth_core: int) -> np.ndarray: zmax = locs[:, 2].max() # top of locs below_core_ind = (zmax - locs[:, 2]) > depth_core core_bottom_elev = zmax - depth_core - locs[ - below_core_ind, 2 - ] = core_bottom_elev # sets locations below core to core bottom + locs[below_core_ind, 2] = ( + core_bottom_elev # sets locations below core to core bottom + ) return locs