emsig / empymod

Full 3D electromagnetic modeller for 1D VTI media
https://empymod.emsig.xyz
Apache License 2.0
85 stars 22 forks source link

article-fdesign notebooks not working for empymod v2 #191

Closed question0825 closed 1 year ago

question0825 commented 1 year ago

the error following below:

Traceback (most recent call last):
  File "/home/hgrjang/empymod/notebooks/gpr.py", line 33, in <module>
    gprDLF = epm.gpr(ht='fht', htarg=epm.fdesign.load_filter('wer2001'), **inp)
  File "/home/hgrjang/miniconda3/lib/python3.10/site-packages/empymod/model.py", line 1508, in gpr
    time, freq, ft, ftarg = check_time(freqtime, 0, ft, ftarg, verb)
  File "/home/hgrjang/miniconda3/lib/python3.10/site-packages/empymod/utils.py", line 1154, in check_time
    args.pop('dfreq', 0.002), float, 0, 'fft: dfreq', ())
TypeError: pop expected at most 1 argument, got 2

How can I fix the errors?

prisae commented 1 year ago

I suspect you use a newer version of empymod (>=v2.0) and an old example.

question0825 commented 1 year ago

I suspect you use a newer version of empymod (>=v2.0) and an old example.

  • What version of empymod are you using?
  • Which example is this? (where do you have it from)?

using empymod v2.2.1 the examples was in https://github.com/emsig/article-fdesign

prisae commented 1 year ago

Yes, as expected. You probably talk about this example, right? https://github.com/emsig/article-fdesign/blob/master/notebooks/A-GPR-create-data.ipynb

At the end of each notebook, there is a table that shows with which version was used to run the notebook. In this case, empymod v1.8.1 was used: Screenshot from 2023-07-04 10-44-47

The quick and dirty solution is installing empymod v1.8.1.

There were significant, non-backward compatible changes for empymod v2+. These changes are listed here: https://empymod.emsig.xyz/en/stable/manual/changelog.html#v2-0-0-numba

I quickly went through this example and put an updated version in the dev-branch, you can find it here: https://github.com/emsig/article-fdesign/blob/dev/notebooks/A-GPR-create-data.ipynb -- with this you should be able to run it.

Currently I lack the time to do more, but I hope this helps.

I also created an issue here to track it: https://github.com/emsig/article-fdesign/issues/1

prisae commented 1 year ago

I am closing this here, as it is tracked over in https://github.com/emsig/article-fdesign/issues/1