@@ -165,7 +165,7 @@ def starting_model(self) -> np.ndarray | None:
165165 mstart = self ._starting_model .model .copy ()
166166
167167 if mstart is not None and self .is_sigma :
168- if self .driver .params .models .model_type == "Resistivity (Ohm -m)" :
168+ if self .driver .params .models .model_type . lower () == "resistivity (ohm -m)" :
169169 mstart = 1 / mstart
170170
171171 mstart = np .log (mstart )
@@ -221,7 +221,7 @@ def reference_model(self) -> np.ndarray | None:
221221 ref_model = mref .copy ()
222222
223223 if self .is_sigma :
224- if self .driver .params .models .model_type == "Resistivity (Ohm -m)" :
224+ if self .driver .params .models .model_type . lower () == "resistivity (ohm -m)" :
225225 ref_model = 1 / ref_model
226226
227227 ref_model = np .log (ref_model )
@@ -263,7 +263,7 @@ def reference_declination(self) -> np.ndarray | None:
263263 def lower_bound (self ) -> np .ndarray | None :
264264 if (
265265 self .is_sigma
266- and self .driver .params .models .model_type == "Resistivity (Ohm -m)"
266+ and self .driver .params .models .model_type . lower () == "resistivity (ohm -m)"
267267 ):
268268 bound_model = self ._upper_bound .model
269269 else :
@@ -283,7 +283,7 @@ def lower_bound(self) -> np.ndarray | None:
283283 if self .is_sigma :
284284 is_finite = np .isfinite (lbound )
285285
286- if self .driver .params .models .model_type == "Resistivity (Ohm -m)" :
286+ if self .driver .params .models .model_type . lower () == "resistivity (ohm -m)" :
287287 lbound [is_finite ] = 1 / lbound [is_finite ]
288288
289289 lbound [is_finite ] = np .log (lbound [is_finite ])
@@ -297,7 +297,7 @@ def lower_bound(self) -> np.ndarray | None:
297297 def upper_bound (self ) -> np .ndarray | None :
298298 if (
299299 self .is_sigma
300- and self .driver .params .models .model_type == "Resistivity (Ohm -m)"
300+ and self .driver .params .models .model_type . lower () == "resistivity (ohm -m)"
301301 ):
302302 bound_model = self ._lower_bound .model
303303 else :
@@ -311,7 +311,7 @@ def upper_bound(self) -> np.ndarray | None:
311311 if self .is_sigma :
312312 is_finite = np .isfinite (ubound )
313313
314- if self .driver .params .models .model_type == "Resistivity (Ohm -m)" :
314+ if self .driver .params .models .model_type . lower () == "resistivity (ohm -m)" :
315315 ubound [is_finite ] = 1 / ubound [is_finite ]
316316
317317 ubound [is_finite ] = np .log (ubound [is_finite ])
@@ -329,7 +329,7 @@ def conductivity_model(self) -> np.ndarray | None:
329329 background_sigma = self ._conductivity_model .model .copy ()
330330
331331 if background_sigma is not None :
332- if self .driver .params .models .model_type == "Resistivity (Ohm -m)" :
332+ if self .driver .params .models .model_type . lower () == "resistivity (ohm -m)" :
333333 background_sigma = 1 / background_sigma
334334
335335 # Don't apply log if IP inversion
@@ -568,8 +568,9 @@ def save_model(self):
568568
569569 model_type = self .model_type
570570 if (
571- model_type == "conductivity_model"
572- and self .driver .params .models .model_type == "Resistivity (Ohm-m)"
571+ model_type
572+ and model_type .lower () == "conductivity_model"
573+ and self .driver .params .models .model_type .lower () == "resistivity (ohm-m)"
573574 ):
574575 model_type = "resistivity_model"
575576
@@ -590,9 +591,10 @@ def edit_ndv_model(self, model):
590591 """Change values to NDV on models and save to workspace."""
591592 model_type = self .model_type
592593 if (
593- model_type == "conductivity_model"
594+ model_type
595+ and model_type .lower () == "conductivity_model"
594596 and getattr (self .driver .params .models , "model_type" , None )
595- == "Resistivity (Ohm -m)"
597+ == "Resistivity (ohm -m)"
596598 ):
597599 model_type = "resistivity_model"
598600
0 commit comments