MiraGeoscience / geoapps

Some applications, mostly in Python, using solutions from Mira Geoscience
MIT License
55 stars 12 forks source link

Analyst TEM inversion using geoapps: Type error #637

Closed craigmillernz closed 8 months ago

craigmillernz commented 10 months ago

When trying to run a TEM (skytem) inversion directly in Analyst using geoapps (on Windows) I get this type error. It appears to be an issue with alpha_x. I've tried setting this to 1.0 (instead or just 1), but makes no difference.

Update: there appears to be no alpha_x written to the ui.json - see attached

White_island_TEM_model1.ui.json

Loading input file . . .
Initializing application . . .
SimPEG tdem inversion started Nov-24-2023:08:56:50
Setting up 4 tile(s) . . .
Done.
Traceback (most recent call last):
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\properties\basic.py", line 868, in validate
    floatval = float(value)
TypeError: float() argument must be a string or a real number, not 'NoneType'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\Dropbox\GIT\geoapps\geoapps\inversion\driver.py", line 477, in <module>
    InversionDriver.start(file)
  File "D:\Dropbox\GIT\geoapps\geoapps\inversion\driver.py", line 426, in start
    driver = BaseDriver.start(filepath, driver_class=inversion_driver)
  File "D:\Dropbox\GIT\geoapps\geoapps\driver_base\driver.py", line 60, in start
    driver = driver_class(params)
  File "D:\Dropbox\GIT\geoapps\geoapps\inversion\airborne_electromagnetics\time_domain\driver.py", line 19, in __init__
    super().__init__(params, warmstart)
  File "D:\Dropbox\GIT\geoapps\geoapps\inversion\driver.py", line 113, in __init__
    self.initialize()
  File "D:\Dropbox\GIT\geoapps\geoapps\inversion\driver.py", line 202, in initialize
    self.regularization = self.get_regularization()
  File "D:\Dropbox\GIT\geoapps\geoapps\inversion\driver.py", line 339, in get_regularization
    reg = regularization.Sparse(
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\properties\base\base.py", line 280, in __call__
    obj.__init__(*args, **kwargs)
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\SimPEG\regularization\sparse.py", line 454, in __init__
    super(Sparse, self).__init__(
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\SimPEG\regularization\base.py", line 354, in __init__
    super(BaseComboRegularization, self).__init__(
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\SimPEG\regularization\base.py", line 208, in __init__
    utils.setKwargs(self, **kwargs)
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\SimPEG\utils\code_utils.py", line 86, in setKwargs
    setattr(obj, attr, kwargs[attr])
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\properties\basic.py", line 676, in fset
    value = scope.validate(self, value)
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\SimPEG\props.py", line 44, in validate
    return super(Float, self).validate(instance, value)
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\properties\basic.py", line 876, in validate
    self.error(instance, value, extra='Cannot cast to float.')
  File "C:\Users\craigm\AppData\Local\miniforge3\envs\geoapps\lib\site-packages\properties\basic.py", line 356, in error    raise error_class(message, 'invalid', self.name, instance)
properties.utils.ValidationError: The Float property 'alpha_x' of a Sparse instance must be a float, Zero or Identity. An invalid value of None <class 'NoneType'> was specified. Cannot cast to float.
Press any key to continue . . .
github-actions[bot] commented 10 months ago

JIRA issue [GEOPY-1227] was created.

domfournier commented 10 months ago

Can you provide your ui.json?

craigmillernz commented 10 months ago

attached to the original post. it looks like alpha_x isn't written to ui.json, only alpha_s

domfournier commented 10 months ago

Right, so we are now using length_scales under the hood. So I suspect that your geoapps may not be on 0.11.0?

craigmillernz commented 10 months ago

ok correct, i'm using the version that comes default with analyst 4.2.1 which is 0.10 i think image

craigmillernz commented 10 months ago

is 0.11 officially out yet?

domfournier commented 10 months ago

Still a release candidate. If you install GA 4.3, it will come with it.

domfournier commented 8 months ago

Are we good with this @craigmillernz, back online?

craigmillernz commented 8 months ago

yes my mistake on this one, all good to close

domfournier commented 8 months ago

Great thanks.