How to use REopt.jl within a python environment #189
Replies: 3 comments
-
|
I haven't accessed and used the julia package within a python environment. But I have installed Julia and run input files through it. When you say "...can't seem to create the right input formats...", are you referring to input files read by Julia? |
Beta Was this translation helpful? Give feedback.
-
|
So I've finally been able to get a response from the REopt package through python. Before, I would be able to run basic calculations through Julia after importing the Pyjulia package in my python file. But when trying to use the REoptLite package in a similar sense, Python was having a lot of issues correctly converting types to Julia types. I have since gotten it to work and return results after running a job. Turns out my main issue wasn't using a Julia object to make the calls. After storing the body of my job (that I would use when POSTing to the API) in a json file using the code below.
This is after setting up my Project.toml/Manifest.toml files after adding the necessary packages to a julia environment within the python repository. |
Beta Was this translation helpful? Give feedback.
-
|
I'm glad you got that to work. Thank you for sharing your solution. I've done something a little similar, but a little different. In a Quarto file in RStudio I used an R code block to build a bunch of input files that I saved in a list, then I pulled that list into a Python code block and looped through the list, sending input files to the API, then in a final R code block I processed all the output. I've been thinking about doing something similar, but using Julia on my computer to do the analysis instead of the API. Your solution may be helpful, so thanks again. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! The original release post for the V3 API alluded to a way of getting around API rate limits, is to use the REopt.jl package to run these calculations locally. The devs then say that it's even possible to access and use this julia package within a python environment.
I feel like I've tried everything to get this to work, but I just can't seem to create the right input formats REopt.run_reopt() requires. Does anyone have any working examples of doing load analysis using REopt.jl in Python?
Beta Was this translation helpful? Give feedback.
All reactions