Skip to content

Commit a1cf0ec

Browse files
authored
Merge pull request #99 from MiraGeoscience/GEOPY-2372
GEOPY-2372: Crash on multiplying int and float in ScaleMisfitMultiplier directive.
2 parents 2e1d9b3 + 264a623 commit a1cf0ec

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

simpeg/directives/directives.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ..typing import RandomSeed
1515

1616
from ..data_misfit import BaseDataMisfit
17-
from ..objective_function import ComboObjectiveFunction
17+
from ..objective_function import BaseObjectiveFunction, ComboObjectiveFunction
1818
from ..maps import IdentityMap, Wires
1919

2020
from ..regularization import (
@@ -1841,8 +1841,6 @@ def name(self, value):
18411841
@property
18421842
def fileName(self):
18431843
if getattr(self, "_fileName", None) is None:
1844-
from datetime import datetime
1845-
18461844
self._fileName = "{0!s}-{1!s}".format(
18471845
self.name, datetime.now().strftime("%Y-%m-%d-%H-%M")
18481846
)
@@ -3027,12 +3025,12 @@ class ScaleMisfitMultipliers(InversionDirective):
30273025
Path to save the chi-factors log file.
30283026
"""
30293027

3030-
def __init__(self, path: Path | None, **kwargs):
3028+
def __init__(self, path: Path | None = None, **kwargs):
30313029
self.last_beta = None
30323030
self.chi_factors = None
30333031

30343032
if path is None:
3035-
path = Path()
3033+
path = Path("./")
30363034

30373035
self.filepath = path / "ChiFactors.log"
30383036

@@ -3081,7 +3079,7 @@ def endIter(self):
30813079
)
30823080

30833081
# Update the scaling
3084-
self.scalings *= scalings
3082+
self.scalings = self.scalings * scalings
30853083

30863084
# Normalize total phi_d with scalings
30873085
self.invProb.dmisfit.multipliers = self.multipliers * self.scalings

0 commit comments

Comments
 (0)