Skip to content

Commit

Permalink
Merge pull request #641 from MiraGeoscience/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
domfournier authored Feb 8, 2024
2 parents 6ca4f92 + d753755 commit 4dedff8
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions geoapps/block_model_creation/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 4 additions & 8 deletions geoapps/inversion/base_inversion_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions geoapps/inversion/components/factories/directives_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions geoapps/inversion/components/factories/survey_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions geoapps/inversion/electromagnetics/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions geoapps/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 4dedff8

Please sign in to comment.