Veda2.0 Released!


Is there a way to adjust to the VTrun.cmd file generated when pressing solve in Veda?
#1
[font=Monaco, Menlo, Consolas, "Courier New", monospace]Is there a way to adjust to the VTrun.cmd file generated when pressing solve in Veda?

I would like to include a gams times-report-script at the end of the VTrun.cmd file after the GDX2VEDA GAMSSAVE line.

The purpose of the gams times-report-script is to collect all relevant output from TIMES in long format, i.e. all attributes and dimensions from our TIMES model are organised into a single parameter and saved as a GDX.

Currently, I run the times-report-script manually after solving TIMES; however, I think it would be a great improvement if it was possible to make the times-report-script run automatically when solving the TIMES from VEDA.

Any help or suggestions would be greatly appreciated :-)

Cheers,

Kristoffer[/font]
Kristoffer S. Andersen <br />Advisor, Danish Energy Agency
Reply
#2
Thanks for this request. We have already made it possible to write GAMS statements in several different locations of the RUN file, at the top/bottom of scenario DD files, and pass GAMS switches to the GAMS call statement in the VTrun.CMD file. See the *cmd* attributes. We can create another parameter to serve your purpose. Can you upload a CMD file with an example of the statement you wish to add?
Reply
#3
(05-04-2022, 03:22 PM)AKanudia Wrote: Thanks for this request. We have already made it possible to write GAMS statements in several different locations of the RUN file, at the top/bottom of scenario DD files, and pass GAMS switches to the GAMS call statement in the VTrun.CMD file. See the *cmd* attributes. We can create another parameter to serve your purpose. Can you upload a CMD file with an example of the statement you wish to add?


Dear Amit, thank you for your positive and fast reply. I attached a illustration of the vtrun (vtrun.txt). In essence, I would like to replace the following code in the VTrun.CMD:
 
Code:
@echo off
Title kp22 [ Test case] [GAMS_WRKTIMES]
CALL ..\GAMS_SrcTIMES.v4.6.0\VT_GAMS kp22 GAMS_SrcTIMES.v4.6.0 GAMSSAVE\kp22 ''  ..\ lo=1 2>&1 | tee "kp22.txt"
GDX2VEDA GAMSSAVE\kp22 ..\GAMS_SrcTIMES.v4.6.0\times2veda.vdd kp22_0404
@echo Closed >RunTerminated

With:
Code:
@echo off
Title kp22 [ Test case] [GAMS_WRKTIMES]
CALL ..\GAMS_SrcTIMES.v4.6.0\VT_GAMS kp22 GAMS_SrcTIMES.v4.6.0 GAMSSAVE\kp22 ''  ..\ lo=1 2>&1 | tee "kp22.txt"
GDX2VEDA GAMSSAVE\kp22 ..\GAMS_SrcTIMES.v4.6.0\times2veda.vdd kp22_0404
gams c:\%pathtimesreportscript%\timesreport.gms --scenname=kp22
@echo Closed >RunTerminated

Since the gams times-report-script needs to run on different computers, it would be ideal if the individual user controls the path for the script, hence the %pathtimesreportscript%\. 

Cheers,

Kristoffer


Attached Files
.txt   vtrun.txt (Size: 359 bytes / Downloads: 6)
Kristoffer S. Andersen <br />Advisor, Danish Energy Agency
Reply
#4
I could not managed to make this functionality work. I would like to run a python script after gdx2veda. It is a powershell command “python script.py”.

I have tried this implementation which appears in the browse but the VTRUN.cmd is not modified.


Do you have any suggestion to make it work please?

Thanks

Victor


Attached Files Thumbnail(s)
   
Reply
#5
Is this scenario file selected in the scenario group you are using for the run?
Reply
#6
Yes, I attached to this reply the RUN file and the DD linked to the excel file which contains the table with CmdF_bot


Attached Files
.zip   files.zip (Size: 1.7 KB / Downloads: 4)
Reply
#7
@VictorG: Where can one find information about this new CmdF_bot?
I could not find it in the online documentation.
Reply
#8
Information can be found here https://veda-documentation.readthedocs.i...-run-files


I found CmdF_bot in the TIMES Attributes with the description: "To append statements after GDX2VEDA call in VTRun.CMD"
Reply
#9
Thanks, found it now, after launching VEDA2 and looking at the list there! 
Instead of launching VEDA2 for such documentation, I seem to have a habit of searching the online VEDA documentation for info on VEDA attributes, and it is not mentioned there: https://veda-documentation.readthedocs.io/en/latest/pages/Run%20Manager.html

I also tried it now, but could not get it working.
Reply
#10
I confirm that something is amiss in this attribute. We will fix this bug asap. Apologies for the inconvenience.
Reply
#11
Apologies for the confusion. These attributes were only partly implemented, and that too only under the restart file option. The version just released enables these attributes in the regular solve as well. Note that the CmdF_* attributes will not be available under Veda online.
Reply
#12
Thank you for this new feature, I managed to use it.

I am trying to do a postprocess on the vd file each time I do a model run. I attached an example in this post of a modified VTRUN.cmd .

I want to apply my command postprocess to the newly created vd file. I added a line after gdx2veda but I am having difficulties to correctly name the vd file. In my example, I would like to have demos_012_postprocess.vd instead of casename.vd .

Is there a possibility to have an access to the veda variable casename ? This value is already used in the VTRUN.cmd for the title.

Do you have suggestions to handle this difficulty ? I can use *.vd but it does not separate the last run from older ones. Something like $casename.vd might be more appropriate.


Attached Files
.zip   vtrun.zip (Size: 347 bytes / Downloads: 4)
Reply
#13
(30-06-2023, 04:05 PM)VictorG Wrote: Thank you for this new feature, I managed to use it.

I am trying to do a postprocess on the vd file each time I do a model run. I attached an example in this post of a modified VTRUN.cmd .

I want to apply my command postprocess to the newly created vd file. I added a line after gdx2veda but I am having difficulties to correctly name the vd file. In my example, I would like to have demos_012_postprocess.vd instead of casename.vd .

Is there a possibility to have an access to the veda variable casename ? This value is already used in the VTRUN.cmd for the title.

Do you have suggestions to handle this difficulty ? I can use *.vd but it does not separate the last run from older ones. Something like $casename.vd might be more appropriate.

Hi Victor,

I have modified VTRUN.cmd file to give you access to vd file name variable. 
Just try it out and let me know if this serves your purpose.


Attached Files
.zip   vtrun.zip (Size: 383 bytes / Downloads: 7)
Reply
#14
Hello

thank you for your answer. It does not meet my need yet. I will try to be more explicit.

My goal is to automate the postprocess of my vd files, I have a python command I want to execute after every run on the newly created vd.

I have few constraints:
-python procedure called after gdx2veda has created the vd file
-be sure it is the newly vd file that is processed and not an older one
-the procedure is linked to the model and the gams_wrk can be executed on different computers with no extra adjustment of the code as long as the computer has the python script

I thought that the attribute CmdF_bot was well suited for my problem because it can store the information of the modification in the dd files and the cmd is modified automatically each time dd files are generated. However there is a small difficulty here because the regular scenarios in excel contain input data while the casename (prefix of the vd)
is linked to the run manager.

The solution that would fit my need is to have an access to the veda variables of the Run manager with the attribute CmdF_bot. I noticed the %1 flag which corresponds to the case name in the VT_GAMS.CMD in the TIMES source code.

A suggestion would be to have an excel file with the following string 'postprocess %1.vd' for CmdF_bot in an excel file and that is interpreted as writing a line after the gdx2veda in the cmd corresponding to: postprocess casename.vd

I hope it is clearer
Reply
#15
If producing a *.vd file with the case name (without any date postfix added) would help, accomplishing that is quite easy.  Please try putting the attached file (extract it from the zip file) to the work folder.  It will cause producing *.vd* files with the correct case name.

[Edit:] Ah... I forgot to change one "demo5" in that cmd to the case name, sorry. It is now updated.


Attached Files
.zip   gdx2veda.zip (Size: 265 bytes / Downloads: 11)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  TIMES-Macro-MSA MSADDF.DD file UNDF Enya 7 320 16-12-2024, 06:06 PM
Last Post: Enya
  Subres File [email protected] 1 154 10-12-2024, 08:51 AM
Last Post: KanORS-AssistGPT
  Controversial handling of CG indexes by VEDA Antti-L 16 2,095 06-08-2024, 07:53 AM
Last Post: AKanudia
  GDX diff fails to find GAMS in VEDA vincedh 2 646 19-04-2024, 06:41 PM
Last Post: vincedh
  Veda online not solving. Getting veda 2.0? frangb99 0 369 17-03-2024, 11:52 PM
Last Post: frangb99
  VEDA Run Manager Module UgurHalden 1 776 21-02-2024, 05:14 PM
Last Post: Ravinder
Photo Installing VEDA in a server without internet acess sergio.vargas.cbba 1 565 06-02-2024, 04:24 PM
Last Post: Ravinder
  Capacity units in gdx/dd files vs veda iris 14 6,027 03-01-2024, 08:04 PM
Last Post: Antti-L
Question VBA code in Veda input files AKanudia 11 3,476 29-12-2023, 09:50 AM
Last Post: AKanudia
  No MIG records generated Antti-L 2 983 29-08-2023, 04:43 PM
Last Post: Antti-L

Forum Jump:


Users browsing this thread: 1 Guest(s)