-
Notifications
You must be signed in to change notification settings - Fork 46
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
Load file partially to avoid buffer overload #435
Comments
Did you check if DyMat supports this? Reading the |
I checked indeed and it doesn't i'm afraid. DyMat uses the scipy.io.loadmat I mentioned but doesn't use the 'variables _names' option so I think it always loads the whole file. |
@Walshest, I haven't. |
@thorade, indeed, exporting a smaller .MAT file is what I ended up doing. Well, I first simulated and stored all variables (might need them for later analysis or used to check the internal workings of the model/controls) then I plotted the once I needed and exported a .MAT file with only those variables. This wasn't convient though and is a lot of manual work for bath simulations. It would be nice to be able to load only a subset of the original .MAT file directly in Python. I haven't actually tried this, but as scipy.io.loadmat can do it, probably the fix is not that far away. Although I don't think there is any active developement for DyMat. |
Hi @thorade and @kldjonge , However there is still a limitation when we run much longer & complex Modelica simulation e.g. for months/ year of seasonal operation.
|
Thanks @Walshest , I agree that it would probably be better to allow BuildingsPy to handle larger results. I will take a look at it. |
Is it possible to only load the .mat file partially?
When only wanting to extract a few variables it seems that still the whole .mat file is loaded. This results in a buffer overload error when the .mat file gets to big (e.g. when also the protected variables were stored for debugging purposes) which might be avoided when only the necessary data is loaded.
I got the inspiration from the optional 'variable_names' argument in de scipy.io.loadmat class.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html
The text was updated successfully, but these errors were encountered: