atmtools/typhon

C API not including ARTS to both ARTS_DATA_PATH and ARTS_XML_PATH

Closed this issue · 5 comments

Bug report

C API does not include the arts-xml-data path in cmake. .typhonrc also seems to be ignored. I have tried using both ARTS_DATA_PATH and ARTS_XML_PATH in .typhonrc but neither works.

Bug summary

Cannot easily read files from arts-xml-data the same way as when using controlfiles when using C API

Code for reproduction

ARTS built with cmake arts-xml-data path defined.

Full .typhonrc:
[environment]
ARTS_BUILD_PATH: path-to-arts-executable-folder
ARTS_DATA_PATH: path-to-arts-xml-data-folder

In script:
from typhon.arts.workspace import Workspace
ws = Workspace()
ws.ReadXML(ws.isotopologue_ratios, "planets/Mars/isotopratio_Mars.xml")

Actual outcome

Exception: Call to ARTS WSM ReadXML failed with error: Cannot find input file: planets/Mars/isotopratio_Mars.xml
Search path: ARTS_PATH HOME_PATH

Expected outcome

I expect that the search path should include ARTS_DATA_PATH and ARTS_XML_PATH. Or at the very least, the arts-xml-data path that is used in cmake when building ARTS.

Version information

  • Python Version: latest Anaconda running via graphical spyder3 on ubuntu

Hopeful feature addition

I write this because I suspect I know what the solution will have to look at, without actually knowing how to solve it...

It would be very nice to be able to call Workspace() with tuples like ('D', "data/") and ("n", 17) [or whatever input format is preferred, I do not really care on that point] to respectively add the data import path of 'data/' and to limit the number of threads to 17. (Especially the latter would be nice since leaving a few threads open makes other things on the computer run more smoothly.)

Hey Richard,

I don't know if the extended handling of the configuration file was sufficiently early to make it into the latest anaconda build. I will check this!

Regarding your second point, the C API should respect the OMP_NUM_THREADS environment variable. But maybe @simonpf is able to comment on this (and the possibility to pass an explicit number of threads).

Cheers,
Lukas

To clarify, I am running latest typhon from here but the python version is the one in anaconda. ARTS_BUILD_PATH is respected

To clarify, I am running latest typhon from here but the python version is the one in anaconda. ARTS_BUILD_PATH is respected

Thanks for clarifying! Indeed, I misread that.

I can't reproduce this bug. Running your snippet works fine for me and I can also print the isotopologue ratios (does not work when commenting out in .typhonrc).

The configuration file is read, when typhon is imported for the first time. Did you change the configuration while typhon was already imported in a running Spyder session?

I found the 'bug'. It was a self-afflicted error. I for some reason had .typhonrc inside the main typhon folder and not in $HOME. The change to add .typhonrc support must have coincided with some other change in Anaconda because I still included the ARTS path. (Since the ARTS workshop, I was able to load the ARTS-build directory regardless of .typhonrc apparently.)

I guess the error that loading ARTS don't automatically include the cmake-path has nothing to do with typhon but resides in ARTS, so I am closing this now. Thanks Lukas !