If the file needs to be uploaded to the container and is located in a directory that is different from the current working directory, the upload_file function fails. There is a limitation in the file transfer utility, but it can be worked around in PySystemCoupling.
📝 Steps to reproduce
Run the following code in a containerized environment (e.g. Ansys Labs)
import ansys.systemcoupling.core as pysystemcoupling
from ansys.systemcoupling.core import examples
examples.delete_downloads()
fmu_file_heater = examples.download_file("thermostat.fmu", "pysystem-coupling/heating_tank_fmu/FMU")
syc = pysystemcoupling.launch(start_output=True)
syc.setup.add_participant(input_file=fmu_file_heater)
Note that add_participant function raises an exception:
IsADirectoryError Traceback (most recent call last)
Cell In[10], line 1
----> 1 syc.upload_file(file_name = fmu_file_heater, remote_file_name = "thermostat.fmu")
🔍 Before submitting the issue
🐞 Description of the bug
If the file needs to be uploaded to the container and is located in a directory that is different from the current working directory, the upload_file function fails. There is a limitation in the file transfer utility, but it can be worked around in PySystemCoupling.
📝 Steps to reproduce
Run the following code in a containerized environment (e.g. Ansys Labs)
Note that
add_participant
function raises an exception: IsADirectoryError Traceback (most recent call last) Cell In[10], line 1 ----> 1 syc.upload_file(file_name = fmu_file_heater, remote_file_name = "thermostat.fmu")💻 Which operating system are you using?
Windows
📀 Which ANSYS version are you using?
24R2
🐍 Which Python version are you using?
3.9
📦 Installed packages