OpenSourceRisk / ORE-SWIG

Other
49 stars 46 forks source link

Cannot run ORE not example files cd from Python #30

Open p-hatstadt opened 7 months ago

p-hatstadt commented 7 months ago

I am trying to use ORE in python. My goal is to first run some of the python examples, starting with Example_42 and go from there. My issue is that if I do "pip install open-source-risk-engine" (which works) then I do not have access to the example files. As a result, I cannot do "python run.py" from the Example_42 folder that contains run.py. So what I did was to clone the repo locally, which allows access to the Example_42 folder. However, upon trying to execute run.py, I get this error: "ORE executable not found". So in order to try and understand what the problem is and debug the code, I tried doing a local installation of the code by doing "pip uninstall open-source-risk-engine", then switch to the "engine" subfolder where I cloned the repo and try to do "pip install -e .". However, upon doing so, I get this error: "ERROR: File "setup.py" or "setup.cfg" not found. Directory cannot be installed in editable mode: C:\Users\Philippe Hatstadt\git\OpenSourceRisk\Engine

So I sort of have nowhere to go right now and help would be appreciated.

rkapl123 commented 7 months ago

The examples in ORE are mostly not to be run with ORE-SWIG. The python code in the examples of the Engine project is usually only for invoking the built ORE executable (with the notable exception of example 42, which requires ORE-SWIG), which you have to build on your own (as of the last version). Or - if you are on windows - you can use this one. Simply klick on download raw file: image You then have to put it into your ORE root into folder App\bin\x64\Release. Then you can run the examples.

p-hatstadt commented 7 months ago

Thank you for the executable, I can now run some of the examples. If I may, I have an immediate question. In the examples, I see this code: from ORE import However, all code appears to call standard QuantLib functions. However, I do have both QuantLib and open-source-risk-engine pip installed in my environment. As a result, the code would also "superficially" work if I did "from QuantLib import ". So my question is this: Am I supposed to pip uninstall QuantLib from the environment from which I pip install and use ORE? I am aware that ORE contains its own QuantLib branch, so I assume that "pip uninstall Quantlib" is the answer, but can you please confirm and otherwise advise?

Regards

Philippe Hatstadt

On Tue, Feb 13, 2024 at 1:36 PM Roland Kapl @.***> wrote:

The examples in ORE are not to be run with ORE-SWIG. The python code in the Engine project is only for invoking the built ORE executable, which you have to build on your own (as of the last version). Or - if you are on windows - you can use this one https://github.com/rkapl123/rkapl123.github.io/blob/master/OREbinaries.zip. Simply klick on download raw file: image.png (view on web) https://github.com/OpenSourceRisk/ORE-SWIG/assets/7430763/243fd53b-b8d0-4d98-8be7-bab792639b9e You then have to put it into your ORE root into folder App\bin\x64\Release. Then you can run the examples.

— Reply to this email directly, view it on GitHub https://github.com/OpenSourceRisk/ORE-SWIG/issues/30#issuecomment-1942163945, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXJDKRNRHYZFHHAFIITFOTYTOXDPAVCNFSM6AAAAABDE6EOW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGE3DGOJUGU . You are receiving this because you authored the thread.Message ID: @.***>

--

31 East 32nd Street, 3rd Floor | New York, NY | 10016

https://www.exosfinancial.com/
https://www.linkedin.com/company/meetexos/about/

Broker-Dealer services offered through Exos Securities LLC, Member SIPC, FINRA. For important disclosures including Form CRS and Regulation BI click here https://www.exosfinancial.com/general-disclosures.

Confidentiality Notice: The information contained in this email (including attachments) is only for the personal and confidential use of the sender and recipient named above. If the reader is not the intended recipient, you are notified that you have received this message in error and that any review, dissemination, copying or distribution is prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete or destroy the original message and all copies.

rkapl123 commented 7 months ago

Judging from the Userguide:

Since release 4, ORE comes with Python and Java language bindings following the QuantLib-SWIG example. The ORE bindings extend the QuantLib SWIG wrappers and allow calling ORE functionality in the QuantExt/OREData/OREAnalytics libraries alongside with functionality in QuantLib.

and the fact that commodityforward.py in example 42 doesn't need a separate Quantlib import while using Quantlib functions, I would say that you can (and probably should) uninstall the Quantlib SWIG module.