Hello everyone,
I have a problem with FME Flow 2023.2.2 and the module xarray 2024.2.0. I need xarray for reading netCDF data and have created a Python script for this in FME Form 2023.2.2. This also runs without any problems. However, when I upload this workspace to FME Flow and start it there, I always get the message that the run has failed.
After some research I found out that FME Flow has problems executing the command xarray.open_dataset(). I'll post the script and the logs of FME Form and Flow:
import fmeobjects
import xarray as xr
class FeatureCreator(object):
"""Template Class Interface:
When using this class, make sure its name is set as the value of the 'Class to Process Features'
transformer parameter.
"""
def __init__(self):
"""Base constructor for class members."""
pass
def input(self, feature: fmeobjects.FMEFeature):
print("Assign file")
file = '/dafis/OpMod/t_file_fine/t_file_fine_2024040300_006_012.nc'
print ('File: ' + file)
print("Load Dataset")
ds = xr.open_dataset(file)
print('Finished Load Dataset')
print(xr.show_versions())
newFeature = fmeobjects.FMEFeature()
self.pyoutput(newFeature)
Here is the Log from FME Form:
Assign file
File: /dafis/OpMod/t_file_fine/t_file_fine_2024040300_006_012.nc
Load Dataset
E:\Python_3_9\lib\site-packages\xarray\conventions.py:286: SerializationWarning: variable 'temp' has multiple fill values {-31111, -32222} defined, decoding all values to NaN.
var = coder.decode(var, name=name)
E:\Python_3_9\lib\site-packages\xarray\conventions.py:286: SerializationWarning: variable 'salt' has multiple fill values {-31111, -32222} defined, decoding all values to NaN.
var = coder.decode(var, name=name)
Finished Load Dataset
Here the Log from FME Flow:
54 | 2024-4-8 10:15:40 | Assign file |
55 | 2024-4-8 10:15:40 | File: /dafis/OpMod/t_file_fine/t_file_fine_2024040300_006_012.nc |
56 | 2024-4-8 10:15:40 | Load Dataset |
As you can see, it simply aborts when executing open_dataset(). Does anyone know this problem? Is there a way for FME to output the error. Even with try - catch no error is output. xarray was installed with pip on the server.