Skip to content
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

Enhancement: return reports as list items when running in library mode #174

Closed
DanWBR opened this issue Jun 13, 2022 · 8 comments · Fixed by #215
Closed

Enhancement: return reports as list items when running in library mode #174

DanWBR opened this issue Jun 13, 2022 · 8 comments · Fixed by #215
Assignees
Milestone

Comments

@DanWBR
Copy link

DanWBR commented Jun 13, 2022

It would be nice to have the HTML, CSV and OPEM reports returned as items in the results list instead of physical files when running in library mode, so the files could be generated from the item contents somewhere else. This is very useful in the context of a chemical process simulator where you can have multiple instances of OPEM objects.

@sepandhaghighi
Copy link
Contributor

@DanWBR Hi
Do you mean something like this?

{               "Status": True,
                "P": Power_List,
                "I": I_List,
                "V": Vstack_List,
                "EFF": Efficiency_List,
                "Ph": Power_Thermal_List,
                "V0": B0,
                "K": B1,
                "VE": Estimated_V,
                "HTML": HTMLContent,
                "CSV":"CSVContent
                "}

@DanWBR
Copy link
Author

DanWBR commented Jun 15, 2022

@sepandhaghighi exactly. If possible, disable the generation of the physical files in the subdirectory. I'm running OPEM from a .NET application through Python.NET - the commands are run in memory and I'm afraid we don't have a "current directory" to refer to in this case.

@sepandhaghighi
Copy link
Contributor

@DanWBR
The problem with this method is that sometimes the output files are too large and can lead to some memory problems.

Take a look at this method (adding Folder and Name parameters to control files location and name):

>>> from opem.Static.Amphlett import Static_Analysis
>>> Test_Vector={"T": 343.15,"PH2": 1,"PO2": 1,"i-start": 0,"i-stop": 75,"i-step": 0.1,"A": 50.6,"l": 0.0178,"lambda": 23,"N": 1,"R": 0,"JMax": 1.5,"Name": "Amphlett_Test"}
>>> data=Static_Analysis(InputMethod=Test_Vector,TestMode=True,PrintMode=False,ReportMode=True,Folder="C:\\Users\\",Name="Test")

Does it work for you?

@DanWBR
Copy link
Author

DanWBR commented Jun 15, 2022

@DanWBR yes, that would work. thanks!

@sepandhaghighi
Copy link
Contributor

Good, we will solve it in the next version 💯

@sepandhaghighi sepandhaghighi added this to the OPEM v1.4 milestone Jun 16, 2022
@DanWBR
Copy link
Author

DanWBR commented Jun 17, 2022

@sepandhaghighi I've found a way already, implemented something like my first suggestion + temporary files:

Captura de Tela 2022-06-17 às 10 41 25

Captura de Tela 2022-06-17 às 10 41 27

@sepandhaghighi
Copy link
Contributor

@DanWBR Well done 🥇
But we will still consider this feature for the next version of OPEM 🚀

@DanWBR
Copy link
Author

DanWBR commented Jun 19, 2022

@sepandhaghighi I couldn't wait, sorry 😅

@sepandhaghighi sepandhaghighi mentioned this issue Nov 7, 2023
@sepandhaghighi sepandhaghighi linked a pull request Mar 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants