-
Notifications
You must be signed in to change notification settings - Fork 41
Regression from v0.6.5 to v0.6.7 #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
As far as I can tell, the only runtime change to PythonFMU between these versions is #220 . I guess this might affect calling executables etc. which you might do in your application. |
import sys
print("sys.executable:", sys.executable)
print("sys.path:", sys.path)
|
On second thought, this codepath should not run when loaded in pyfmi (as the Python interpreter is already running). |
I was originally thinking 220, but I don't think that one is the issue at this point. @elac-safran can you provide more insights into what the model does as part of running the constructor? Access to files, running executables etc. @Jorgelmh any insights? |
Maybe @fcollonval can help, too, as he participated in both projects. |
Here is the fmu file (renamed as a zip file) generated by v0.6.7: |
I got this error:
I will look more into it. |
Thank you for the update. Some module name I do not provide in my code? |
Seems like a separate issue for now. |
I am able to reproduce the issue with v0.6.6. 0.6.5 works fine. |
Sorry, I was to quick. What I have found is that the model do in fact work the same way with these versions. However, the model fails when it is reloaded (also with older versions) within the same process (after it as successfully been run). I used FMPy for this. I also ran the 0.6.7 model with ecos (C++) successfully. Reloading worked with one of the samples in /examples. The separate issue I encountered is that I have issues running models with Python 3.12. I'm on Windows. I used 3.10 for the successful tests. |
Hmm, that suggests I have room for improvement on my side; thank you very much for your time and your feedback. Just to be sure I understand: the model I sent you works for all versions of |
Basically, yes. I tested with 0.6.3, 0.6.5, 0.6.6, 0.6.7. And as far as I can tell (Windows, Python 3.10). It behaves the same. FMpy is the only tool I tried reloading, and that is were it fails with the error you previously showed. I tested multiple instances of the model with ecospy and that went fine. However, the temp dir could not be deleted, which suggests a dll is still in use after teardown. |
Thank you for this clarification. The way things go south in my code is still mysterious to me, but your tests really help. I definitely have homework to do! |
Hello. I am experiencing a crash from version 0.6.5 to version 0.6.7 in a piece of code that has been running seamlessly for years.
Technically, the error is raised by
fmilib
throughpyfmi
, but I have tried with different versions of this library, and the only trigger seems to bepythonfmu
v0.6.7.The code (a unit test) goes something like:
Function
to_fmu
is on my end, and usesFmuBuilder.build_FMU
.Log with v0.6.5:
Log with v0.6.7:
Do you have any idea as to what could trigger the
FileNotFoundError
in the second case?The text was updated successfully, but these errors were encountered: