[Cmpl] PyCMPL: Export CDAT?

Ogden, Bhrett A. ogdenba at cdmsmith.com
Mon Nov 20 17:57:09 EST 2017


Mike,

Thank you for the tip. While following this trail I stumbled upon the saveDataFile() function in Cmpl.py, which provides exactly what I needed. The benefit for me using this function as opposed to copying the temp file is that I don’t have to use debug mode and the filename is predictable (matches my cmpl file, rather than having a random number attached like in debug mode). This allows me to then move or rename as needed for archiving purposes.

Thanks for your assistance. I hope others find this approach helpful.

Best,
Bhrett

From: Mike Steglich [mailto:mike.steglich at th-wildau.de]
Sent: Friday, November 17, 2017 1:49 PM
To: Ogden, Bhrett A. <ogdenba at cdmsmith.com>
Subject: Re: [Cmpl] PyCMPL: Export CDAT?

Hi Bhrett,

PyCmpl writes all temp file into the TMP folder and delete these files after solving the problem.  There is a non-documented method Cmpl.debug(mode) in pyCmpl with that this behaviour can be influenced. If your Cmpl object is model then you can use model.debug(True) before model.solve(). PyCmpl awaits hitting a key and before you do that you can obtain the temp files.

A export function sounds like a good idea. I could send a beta version with that function if the workaround described below is not comfortable.

Cheers,

Mike

Am 17.11.2017 um 19:13 schrieb Ogden, Bhrett A. <ogdenba at cdmsmith.com<mailto:ogdenba at cdmsmith.com>>:
I am exploring the possible use of building CMPL into a desktop application, which will have a database as part of the backend. In my application, I would like to leave the problem specification without data. That is to say that I would have a CMPL file and read data in from the databases in Python. I would then use pyCMPL to add my data and solve the problem. One thing that would be very helpful for archiving model runs would be a way to export a CDAT file that represents the data added in my pyCMPL code. I have looked through the documentation, and I do not see this feature offered (although I see ways that I could process the data and form the file myself). Is there a built-in way to export a CDAT file that I’m missing? If not, might this be something that would be included in future versions?

Thank you for your hard work on CMPL.

Best,
Bhrett
_______________________________________________
Cmpl mailing list
Cmpl at list.coin-or.org<mailto:Cmpl at list.coin-or.org>
https://list.coin-or.org/mailman/listinfo/cmpl<https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_cmpl&d=DwMFaQ&c=NpiPIT1KNSO0vXgGk6ogJQ&r=lti1h6i9rU5mEC99NvhtD9QtmLoHcyEs5V5LTq78EsM&m=T24xJHoyAzQvqC2En8i2oik_-3o666chgVrZGRW5kEc&s=7zpW170zdnkCDDtGZD_pcFBgDbVwoF4OTR5ZyvOCyUc&e=>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cmpl/attachments/20171120/39a7a08a/attachment.html>


More information about the Cmpl mailing list