fmihpc / analysator

Python based package for analyzing vlsv files produced by Vlasiator
GNU General Public License v2.0
5 stars 32 forks source link

get_config() #193

Closed kostahoraites closed 11 months ago

kostahoraites commented 11 months ago

There is some issue with using get_config() to read the config files for E** runs. get_config() works for FHA and FIA afik, but when for a EGL .vlsv file it throws an error like so:

f.get_config() Traceback (most recent call last): File "", line 1, in File "/proj/horakons/analysator/pyVlsv/vlsvreader.py", line 649, in get_config fa = re.findall(r'[\w+]|\w+ = \S+', self.get_config_string()) File "/proj/horakons/conda/myconda/lib/python3.8/re.py", line 241, in findall return _compile(pattern, flags).findall(string) TypeError: expected string or bytes-like object

Thought I had tested both EGL and FHA before putting in the PR, but maybe I missed something.

kostahoraites commented 11 months ago

chatted with Markku, the error is likely because the .config files for some old runs such as EGL haven't been migrated to turso. Moving those files likely resolves the issue

alhom commented 11 months ago

Rather, the config isn't in the older .vlsv files and adding a check against a missing config_string (with an explanation message/warning output) would be the solution.

markusbattarbee commented 11 months ago

Fixed it directly in master.