Dear ARTS developers,

I am updating my retrievals at the moment to switch to pyarts 2.4.0 and make it 
work with the stable ARTS v2.4.x.


It seems to work because I get the same results as "previously" but I still get 
an TypeError message each time the inversion_iterate_agenda is run, i.e. at 
each OEM iteration.

By previously I mean 2 cases:

  1.  Using the Typhon ARTS interface and ARTS 2.4.0
  2.  Using pyarts 2.5.0 built with ARTS 2.4.x but a few commits behind 
(actually b1ca4e0ff8756e416c38096cd1b9b678cb041c30). On this one, I believe was 
building the last ARTS master branch but still runs with ARTS2.4.x


Note that the error does not prevent the OEM to continue and to converge to a 
value which seems right to me (and similar to previous runs without this 
logging error) but still I think it would be nice to understand why it's 
appearing and if this is something to worry about.


I copied the error OEM function call, the inversion_agenda definition and the 
full error message (a bit nasty sorry). The last part (in red) is maybe already 
enough to understand what is wrong though.


I hope this is not too confusing and I thank you in advance for your time.


Best,
Eric



######################################################

My OEM call:


ws.OEM(method='gn', max_iter=10, stop_dx=20, lm_ga_settings=lm_ga_settings, 
display_progress=1)


######################################################

My inversion agenda:


@arts_agenda
def gromora_inversion_agenda(ws):
            """Custom inversion iterate agenda to ignore bad partition 
functions."""
            ws.Ignore(ws.inversion_iteration_counter)

            ws.xClip(ijq=0, limit_low=0.00000000001, limit_high=0.00002)

            # Map x to ARTS' variables
            ws.x2artsAtmAndSurf()
            ws.x2artsSensor()

            # To be safe, rerun some checkss
            ws.atmfields_checkedCalc(negative_vmr_ok=True)
            ws.atmgeom_checkedCalc()

            # Calculate yf and Jacobian matching x
            ws.yCalc() # ws.yCalc(y=ws.yf)

            # Add baseline term
            #ws.VectorAddElementwise(ws.yf, ws.y, ws.y_baseline)
            ws.VectorAddVector(ws.yf, ws.y, ws.y_baseline)

            # This method takes cares of some "fixes" that are needed to get 
the Jacobian
            # right for iterative solutions. No need to call this WSM for 
linear inversions.
            ws.jacobianAdjustAndTransform()


######################################################

The error message:


--- Logging error ---
Traceback (most recent call last):
  File "/opt/ARTS/arts2.4.x/build/python/pyarts/workspace/workspace.py", line 
135, in callback
    eval(compile(m , "<unknown>", 'exec'), context)
TypeError: required field "type_ignores" missing from Module

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/logging/__init__.py",
 line 1085, in emit
    msg = self.format(record)
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/logging/__init__.py",
 line 929, in format
    return fmt.format(record)
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/logging/__init__.py",
 line 668, in format
    record.message = record.getMessage()
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/logging/__init__.py",
 line 373, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/runpy.py", line 
194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/runpy.py", line 
87, in _run_code
    exec(code, run_globals)
  File 
"/home/es19m597/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/__main__.py",
 line 45, in <module>
    cli.main()
  File 
"/home/es19m597/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py",
 line 444, in main
    run()
  File 
"/home/es19m597/.vscode/extensions/ms-python.python-2021.12.1559732655/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py",
 line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/runpy.py", line 
265, in run_path
    return _run_module_code(code, init_globals, run_name,
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/runpy.py", line 
97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File 
"/opt/anaconda/miniconda3/envs/GROMORA_retrievals/lib/python3.8/runpy.py", line 
87, in _run_code
    exec(code, run_globals)
  File 
"/home/es19m597/Documents/GROMORA/GROMORA-harmo/scripts/retrieval/retrieve.py", 
line 203, in <module>
    ac, retrieval_param, sensor_out = instrument.retrieve_cycle(
  File 
"/home/es19m597/Documents/GROMORA/GROMORA-harmo/scripts/retrieval/gromora_retrievals.py",
 line 1383, in retrieve_cycle
    ac.oem(
  File 
"/home/es19m597/Documents/GROMORA/GROMORA-harmo/scripts/pyretrievals/retrievals/arts/interface.py",
 line 436, in oem
    ws.OEM(method=method, max_iter=max_iter, stop_dx=stop_dx, 
lm_ga_settings=lm_ga_settings,
  File "/opt/ARTS/arts2.4.x/build/python/pyarts/workspace/workspace.py", line 
271, in __call__
    self.m.call(self.ws, *args, **kwargs)
  File "/opt/ARTS/arts2.4.x/build/python/pyarts/workspace/methods.py", line 
445, in call
    e_ptr = arts_api.execute_workspace_method(ws.ptr, m_id,
  File "/opt/ARTS/arts2.4.x/build/python/pyarts/workspace/workspace.py", line 
137, in callback
    logger.error(r"Exception in Python callback:\n", e)
Message: 'Exception in Python callback:\\n'
Arguments: (TypeError('required field "type_ignores" missing from Module'),)

_______________________________________________
arts_users.mi mailing list
arts_users.mi@lists.uni-hamburg.de
https://mailman.rrz.uni-hamburg.de/mailman/listinfo/arts_users.mi

Reply via email to